ORCHARD PARK, N.Y. — A month after firing their special-teams coordinator, the Detroit Lions kicking-game woes caught up with them again.

Matt Prater missed a 48-yard field goal wide right with 5:50 to play and the Lions botched the operation on an extra-point try early in the game to lose to the Buffalo Bills, 14-13, at New Era Field.

The loss virtually eliminates the Lions, now 5-9 with two games to play, from playoff contention. If the Minnesota Vikings (6-6-1) win today – they lead the Miami Dolphins in the fourth quarter – the Lions will be eliminated officially.

Prater had been Mr. Reliable for the Lions most of the season. He was a perfect 25 of 25 on extra points entering the game and had made 15 straight field goals, with his last miss coming in a Week 5 win over the Green Bay Packers.

But the Lions failed to convert on an eight-play, 45-yard drive that covered more than four minutes in Sunday’s fourth quarter, then couldn’t get a stop on Buffalo’s final possession, after Jarrad Davis jumped offsides on third-and-7 to give the Bills an extra crack at a first down.

Prater’s miss came when the Lions appeared to play for a field goal midway through the final period.

After driving to the Buffalo 33-yard line with about 6 minutes to play, the Lions called a bubble screen for undrafted rookie receiver Brandon Powell that gained 3 yards. Prater missed on the next play.

The Bills and Lions traded three-and-outs, and Buffalo ran the final 2:50 off the clock after Josh Allen completed a 25-yard pass to Jason Croom early in the drive then converted on fourth-and-inches with a quarterback sneak.

The Lions appeared to get a stop on third-and-7 on the final drive, when Darius Slay broke up an Allen pass downfield. But Davis jumped offside before the snap.

Keith Ford, playing running back after injuries to LeSean McCoy and Chris Ivory, gained 1 yard on third-and-1, and Allen dove over the top of the line of scrimmage on fourth down.

The Lions have now lost six of their last eight games and are guaranteed to finish with their worst record since at least the 2015 season, when they went 7-9 and fired general manager Martin Mayhew and president Tom Lewand mid-season.

The Lions managed just 313 yards of offense against the NFL’s No. 1-ranked defense, and struggled to move the ball outside of two series in the first half when Kenny Golladay turned in a handful of big plays.

Golladay had seven catches for a career-high 146 yards and ripped one interception away from a Bills defender to help set up Zach Zenner’s 1-yard touchdown run.

Matthew Stafford finished 21 of 28 passing for 206 yards and threw a 4-yard touchdown pass to Andy Jones early in the second quarter, but the Lions botched the extra point and led just 6-0 after that score.

Allen answered with a 3-yard touchdown run for the Bills, deeking Davis on his way to the end zone, and he threw what proved to be the game-winning 42-yard touchdown pass to Robert Foster over Michael Ford with 10:26 to play.

Zenner had 15 yards on 10 carries for the Lions, while Allen completed 13 of 26 passes for 204 yards and added 16 yards rushing for the Bills (5-9).

Contact Dave Birkett: dbirkett@freepress.com. Follow him on Twitter @davebirkett. Download our Lions Xtra app for free on Apple and Android!

Make it easy to keep up to date with more stories like this. Download the 13 ON YOUR SIDE app now.

Have a news tip? Email news@wzzm13.com, visit our Facebook page or Twitter.