BOSTON (CBS) -- Everything was in place for a dramatic comeback on Sunday.
And then Cam Newton fumbled.
The Patriots quarterback ran to the left side after the Patriots had marched into the Buffalo red zone, needing just a field goal to tie or a touchdown to win.
But with under 40 seconds to go, Newton didn't protect the football. Justin Zimmer punched the ball loose from Newton, and Dean Marlowe recovered it at the 13-yard line.
From there, Buffalo's Josh Allen took some knees and killed the clock, allowing Buffalo to come away with a huge 24-21 win over the Patriots.
The loss drops the Patriots to 2-5, all but eliminating them from any AFC East contention and putting their playoff prospects in extreme peril. The Bills improved to 6-2.
Newton was 15-for-25 for 174 yards with no touchdowns or interceptions. He rushed for 54 yards on nine carries, before the costly fumble.
Allen was 11-for-18 as a passer for 154 yards with no touchdowns and one interception, while also rushing for 23 yards and a touchdown on 10 carries.
The game started in great fashion for the Bills, who forced the Patriots to punt on the opening drive before embarking on a 10-play, 78-yard touchdown drive to take an early 7-0 lead.
Offense was tough to come by for both teams after that, though, on this windy and wet first half in Orchard Park. The Patriots got on the board with a field goal drive early in the second quarter, driving 44 yards on eight plays before Nick Folk pierced the wind with a 43-yard field goal.
Later in the first half, Allen and Stefon Diggs were not on the same page, as the QB delivered a pass directly to the chest of Patriots cornerback J.C. Jackson, who picked off the pass and returned it 25 yards.
On the drive that followed, Newton hit Jakobi Meyers for a 10-yard gain before hitting Ryan Izzo on back-to-back plays -- first for 15 yards on a nifty flip play, then for nine more yards -- to get the Patriots into field-goal range. Folk kicked a 33-yarder, cutting Buffalo's lead to 7-6 before halftime.
The Bills, though, buzzed right through the Patriots' defense with ease on the first drive of the second half. A 41-yard catch-and-run from Allen to Diggs got the Bills down to the Patriots' 4-yard line, and Zack Moss drove the pile into the end zone on the next play to give Buffalo a 14-6 lead.
The two teams exchanged punts (with rookie Josh Uche tackling Allen in the open field to force Buffalo's) before Gunner Olszewski's 15-yard return set the Patriots up at the Buffalo 37-yard line. Rex Burkhead spun off a tackling attempt by Matt Milano before diving for a gain of 10 on a third-and-10, and Damien Harris broke a tackle of his own en route to a 22-yard touchdown run. A successful two-point conversion pass from Newton to Meyers made it a tie game at 14-14.
The Patriots tried to seize momentum after that with an onside kick, but the move didn't fool Buffalo's Tyler Matakevich, who easily made the recovery for Buffalo. The Bills capitalized on that short field, driving 45 yards on nine plays (all rushing), with Allen rushing up the gut on a designed run on a third-and-goal from the 2-yard line. Tyler Bass' PAT made it a 21-14 lead for Buffalo with 13:16 left in the fourth quarter.
The Patriots' offense came right back. Newton hit Damiere Byrd for 22 yards then connected with the receiver again for nine yards, before Harris ran for 38 combined yards on three straight carries. On a third-and-goal from the 2-yard line, Newton ran to the left side and found a way to the end zone. The PAT was good, and the game was tied at 21-21.
The Bills kept the second-half offensive momentum going by once again driving the length of the field. But on a third-and-5 from the New England 10-yard line, receiver Gabe Davis allowed an Allen pass to sail directly through his arms. The Bills settled for a 28-yard Bass field goal to take a 24-21 lead with 4:10 left in the fourth quarter.
MORE GAME CONTENT:
The 2-5 Patriots play on Monday Night Football next week, in New Jersey against the 0-7 Jets.
for more features.