While the Patriots (12-3) won for the 10th time in 11 games, the Bills (8-7) were dealt a serious blow in their bid to end a 17-year playoff drought.
The Patriots clinched their eighth straight 12-plus-win season, an NFL record. New England hosts the New York Jets needing only a win for the top seed, while the Bills are at Miami next week in the teams' regular-season finales.
Patriots running back Mike Gillislee, rescued from oblivion because of injuries to James White and Rex Burkhead, snapped a 16-16 tie with a 1-yard run late in the third quarter, and Dion Lewis ran for a career-high 129 yards and a touchdown. Lewis also scored on a nifty 12-yard screen pass to help break the game open in the fourth.
Tom Brady, guilty of a pick-six by Jordan Poyer that gave the Bills a 10-3 second-quarter lead, also threw a TD pass to Rob Gronkowski to reach 30 touchdown passes for the seventh time in his career (fourth most all time).
The Bills have never won at Gillette Stadium when Brady has played a complete game.
The interception was the sixth thrown by Brady in the past five games. It is the second time in his career -- first since 2002 -- he has thrown at least one interception in five consecutive games.
Gillislee, a former Bill, scored his fifth touchdown of the season, his first since Week 2.
Brady, in his 250th career start, which is third all-time among quarterbacks, finished 21 of 28 for 224 yards. Gronkowski, who made a one-handed catch on his touchdown reception, had five catches for 67 yards after his wrecking-ball game against the Pittsburgh Steelers last week.
The Patriots benefitted from two overturned calls. One of those rulings took a Buffalo touchdown off the scoreboard.
NFL television officiating analysts Mike Pereira and Dean Blandino both thought Kelvin Benjamin had a touchdown near the end of the first half. The call was overturned, and Buffalo settled for a field goal.
Bills coach Sean McDermott also made a curious decision early in the fourth quarter. Down by seven, the Bills had a fourth-and-1 at the New England 32 -- and McDermott elected to go for a 50-yard field goal by Stephen Hauschka, who missed badly.
Hauschka, who hails from the area, kicked three field goals, while Stephen Gostkowski kicked three for the Patriots.
New England wide receiver Brandin Cooks cleared the 1,000-yard mark for the third straight season and gave the Patriots two 1,000-yard receivers (Gronkowski the other) for the sixth time.
Buffalo running back LeSean McCoy ran for 71 yards and caught five passes for 76 more. Quarterback Tyrod Taylor, who converted on four straight third-down situations on his team's opening drive, was 21 of 38 for 281 yards in the loss.
Bills running back Travaris Cadet, who played one game with the Patriots in 2015, was carted off late in the first half with an apparent serious right ankle injury after he was hit by Trey Flowers. The New England defensive end walked away from the scene with both hands covering his helmet.
NOTES: Bills CB E.J. Gaines, who sustained a knee injury in the win over Miami, was questionable for the game and was ruled out. ... Patriots K Stephen Gostkowski cleared the 150-point mark for the season for the sixth time, extending his NFL record, and he became the 19th player to reach the 1,600-point career mark. ... Bills DT Kyle Williams sacked New England QB Tom Brady for the second time this season and moved into sixth place on the team's all-time list with 43.5.