NFL: Buffalo Bills at New England Patriots

Patriots wide receiver Julian Edelman dives across the goal line for a touchdown between Bills linebacker Lorenzo Alexander and safety Micah Hyde during the second half of Sunday’s NFL game at Gillette Stadium in Foxborough, Mass.

FOXBOROUGH, Mass. — Just like that, the Patriots are back in the coveted No. 2 spot in the AFC.

After losing two straight December games for the first time since 2002, New England stumbled to a 24-12 victory over the Buffalo Bills Sunday. Minutes after it ended, the Eagles, who lost a late lead, nipped Houston 32-30 in Philadelphia on a last-second field goal.

The Patriots and Texans are tied for the second seed and the first-round bye. But the Pats, who have the Jets at home next week and are 7-0 at Gillette, have the tie-breaker thanks to a win over Houston.

The Patriots, whose locker room erupted when Jake Elliott kicked the winning field goal in Philly, also ended the day technically alive for the top seed, pending what happened to the Chiefs at night.

“It’s hugely important to finish strong. It’s a great opportunity,” Tom Brady said after the rushing attack carried the team on a day Brady threw for just 126 yards but raised his career record against Buffalo to 30-3.

The win also clinched the 10th straight AFC East title for New England, the 18th in 25 years of Robert Kraft;s ownership. At 10-5, the Patriots reached double figures in wins for the 16th straight season.

“I certainly don’t take it for granted,” Brady said of the division titles. “I know how hard it is.”

They won on a day they turned the ball over three times, saw Brady, facing the No. 1 pass defense in the league, with a passer rating of 48.3 — his low since 2006 — and had Rob Gronkowski catch zero passes for the third time in his career (three targets).

“I’m just happy we won,” Brady said. “We didn’t have our best day in the passing game but we won and I think everybody’s pretty happy about that.”

In a sloppy game (six combined turnovers) on a chilly day at Gillette Stadium, the Patriots (10-5) ran the ball well and forced the inept Buffalo offense into three turnovers and a meaningless (except to the gamblers, with a 14-point spread) touchdown with 1:08 left.

The Bills (5-10) came into the game allowing an average of 104.8 yards per game on the ground. But rookie Sony Michel ran for 116 of New England’s 273 yards on the ground, including a four-yard touchdown.

James White scored on a 27-yard run — his first TD in six games — and Julian Edelman (six catches, 70 yards) had an acrobatic touchdown catch and run.

Edelman sported an AFC East title cap in his post-game interviews, the room in a much-better collective mood than it was after learning Thursday the team had lost Josh Gordon to another drug suspension. Duron Harmon at one point yelled, “Shout out to Nick Foles,” the QB who led the Eagles past the Texas on Sunday.

Said coach Bill Belichick: “It’s always a great feeling to win the division. It’s been a tough couple of weeks for our guys but they responded with a great week of practice … it’s good to know our season’s going to extend a little bit here; good way to celebrate Christmas.”

Receiver Cordarelle Patterson ran for 66 yards on four carries in the first half before leaving with the knee injury.

“When we run the ball successful it opens everything else up,” said White, who had 41 yards rushing and caught two passes for 13 yards.

Brady was just 13 of 24 for 126 yards, two interceptions and a 48.3 rating, his lowest since a 34.0/four-interception game against Indianapolis in 2006. Brady, whose rating was the seventh-worst of his career, sat out the final 6:39, but said afterward, “I feel great. I feel a hundred percent … I’m not injured.”

Belichick, whose quarterback is 41 and banged up, said of his move to replace Brady late with Brian Hoyer. “Because I thought it was the right thing to do.”

One of the interceptions went through Gronkowski’s hands, the other when Rex Burkhead (79 yards total offense) turned the wrong way. Burkhead also coughed up a fumble.

Jason McCourty, who came to New England to play with his twin brother after an 0-16 season in Cleveland, had a forced fumble and an interception. His brother, Devin, said he was glad to get his brother the “hat and T-shirt,” Devin’s ninth.

Rookie J.C. Jackson, also winning his first division, also had an interception.

While Buffalo ran for just 72 yards, rookie Josh Allen, who didn’t get much help from receivers either dropping the ball or, in one case losing one in the sun, was 20 of 41 for 217 yards.

He threw the late 31-yard TD to Zay Jones. A talented runner, Allen ran for 30 yards for five carries and also wasn’t sacked.