ORCHARD PARK, N.Y. — Once again, the Eagles defense dragged its offense to the finish line.

The Eagles squeaked out a 13-12 victory over the Buffalo Bills on a cold, rainy evening at Highmark Stadium thanks to Vic Fangio ‘s dominant unit. Despite going up, 13-0, in the first half, the Eagles punted on all five of their possessions in the second, routinely putting their defense in difficult situations.

The Bills notched a pair of touchdowns on two straight drives — both on Josh Allen Tush Pushes — late in the fourth quarter. Bills head coach Sean McDermott opted to go for two to win it, but Allen’s pass was incomplete. Dallas Goedert recovered the ensuing onside kick with four seconds remaining to seal the win.

Here’s our instant analysis from the Eagles’ third straight victory:

Allen’s costly turnover

The Bills had early momentum on their second possession, but squandered it to set the tone for much of the first three quarters. They were just outside the red zone thanks to Allen’s 50-yard completion to wide receiver Brandin Cooks.

On second-and-3 from the Eagles’ 23-yard line, Allen faked a handoff to running back James Cook, then rolled out to his right. He had Jalen Carter in his face, forcing Allen to scramble away.

As Allen fled Carter, he attempted to tuck the football, but Jaelan Phillips knocked it out of his grasp. The ball bounced past midfield, where Jihaad Campbell fell on top of it, beating out Bills right guard O’Cyrus Torrence.

The Eagles made Allen pay for his mistake. On the second play of the drive, Jalen Hurts completed a 27-yard deep ball to A.J. Brown with Bills safety Cole Bishop and cornerback Christian Benford trailing in his wake to bring the Eagles to the Bills’ 14.

Hurts eventually went back to his favorite red-zone target — Goedert. The 30-year-old tight end hauled in a pass in the end zone from Hurts out of an under-center play action look in 14 personnel (four tight ends, including depth tackle Matt Pryor).

The Eagles went up, 7-0, on the heels of Allen’s mistake.

Defense does its best

Fangio’s unit ensured that Allen was under duress for the majority of the game.

The pass rush gave him fits. Allen was sacked five times — twice by Jalyx Hunt and once each by Phillips, Moro Ojomo, and Carter.

Carter, the 24-year-old defensive tackle, made his return to action after a three-week layoff due to a pair of shoulder injuries. He dominated the Bills’ offensive line, notching his sack when he obliterating Torrence on his way to Allen in the second quarter. Carter also had a critical extra point block after Buffalo scored its first touchdown of the game in the fourth quarter.

The Eagles were the more physical team. On the play following Carter’s sack, Reed Blankenship crashed down on a short pass to wide receiver Khalil Shakir over the middle and stuffed him, forcing the Bills to go three-and-out.

Late in the third quarter, the Eagles defense bent but didn’t break. Quinyon Mitchell had a shaky drive, getting flagged for defensive pass interference and then conceding a 32-yard catch at the hands of wide receiver Terrell Shavers to the Eagles’ 7-yard line.

The Eagles didn’t blink and mustered a goal-line stand. On third-and-goal from the 2, Marcus Epps stuffed Cook for a loss of a yard. Allen attempted to scramble on the ensuing fourth down, but Zack Baun tackled him short of the goal line to force a turnover on downs.

Allen wasn’t finished making costly plays. On the Bills’ next possession, on third-and-8 from the Eagles’ 27, Hunt sacked Allen for a loss of 19 yards. The 24-year-old outside linebacker’s play pushed the Bills out of field goal range and forced them to punt.

Offense sits back

After punting on their first two possessions of the game, the Eagles offense eventually got going. They scored points on all three of their possessions following Allen’s fumble — the Goedert touchdown and a pair of Jake Elliott field goals (for 47 and 28 yards).

The Eagles were balanced in the first half on offense. The run game averaged 4.0 yards per carry, with Saquon Barkley averaging 4.6. Hurts was fairly efficient in the passing game, going 13-for-20 for 110 yards and the touchdown throw to Goedert. Brown eclipsed 1,000 receiving yards on the season with his five receptions for 68 yards in the first half.

The second half was a different story. The Eagles punted on all five possessions, collecting just 17 yards of offense in that span. The Eagles went three-and-out on four of those drives.

The Bills eventually capitalized on the strong field position afforded them by the struggling Eagles offense. After the Eagles went three-and-out for a fourth time, ending their drive at their own 24, the Bills started the following possession from their own 46. They marched down the field, capping it off with a Allen Tush Push for a touchdown to make it 13-6, Eagles.

Negative plays wrecked the Eagles. Barkley had eight carries for 17 yards in those five possessions, averaging 2.1 yards per play. Hurts did not complete a pass on seven drop backs in the second half.