FOXBOROUGH, Mass. — Rob Gronkowski always has been proud of his roots growing up outside of Buffalo, New York.

He also never has forgotten how his hometown team didn’t want him.

Tom Brady passed for a pair of touchdowns Sunday, including Gronkowski’s one-handed grab, and the New England Patriots stayed on track for home-field advantage throughout the AFC playoffs with a 37-16 victory against the Buffalo Bills.

Combined with Jacksonville’s loss at San Francisco, New England clinched a first-round bye for the playoffs. If Pittsburgh loses Monday at Houston, the Patriots (12-2) will be home throughout the AFC postseason.

It was Gronkowski’s 12th touchdown catch in 13 career games against the Bills, more than he’s had against any other opponent.

“It’s cool when your hometown team passed on you twice in that (2010) draft. And you kind of remember it still,” Gronkowski said. “No lie, I remember it every single time I play them.”

Dion Lewis, who caught a touchdown pass and rushed for a 4-yard score, carried 24 times for a career-high 129 yards – his second career 100-yard game. Mike Gillislee, active for the first time in six games, added a 1-yard rushing touchdown.

Even with the loss, the Bills (8-7) remain in contention to break their 17-year playoff drought – the longest active streak in North America’s four major professional sports and the longest in the NFL since the 1970 merger.

New England has won at least 12 games in eight straight seasons – an NFL record.

After a 13-13 halftime tie, the Bills managed just three more points.

Trailing 13-10, Buffalo was in position to take the lead, but an apparent 4-yard touchdown pass from Tyrod Taylor to Kelvin Benjamin in the corner of the end zone was overturned after an official review.

Benjamin said he thought it was a catch.

“I mean, definitely, but the ref made the call and you’ve got to live with that,” he said.

Al Riveron, the NFL vice president of officiating, said in a Twitter post that Benjamin was juggling the ball and was only able to get one of his feet down before completing the catch.

“When Kelvin Benjamin gains control, his left foot is off the ground. The receiver only has one foot down in bounds with control. Therefore, it is an incomplete pass,” Riveron wrote.

That was echoed postgame by the referee, Craig Wrolstad.

“It was clear and obvious that he did not have control of the ball until he brought it all the way down into his chest,” Wrolstad said in a pool report.

The Bills were forced to settle for a 23-yard field goal as the half expired.

The play elicited immediate reaction on social media.

“Regarding the Buffalo no touchdown, nothing more irritating to an official than to make a great call and then someone in a suit in an office in New York incorrectly reverses it,” the former NFL officiating VP, Mike Pereira, wrote on Twitter.

The score was 3-3 on Buffalo’s second possession when Taylor was sacked on a fourth-and-2 by Marquis Flowers. On the next New England drive, Brady’s third-down pass intended for Kenny Britt was intercepted by Jordan Poyer and returned 19 yards for a touchdown.

It was Brady’s eighth interception of the season. He threw two in the first 10 weeks but now has six in his last five games.

The mistake only momentarily slowed down New England’s offense. Brady capped a nine-play, 75-yard drive with a 17-yard pass that Gronkowski pulled in with one hand to make it 10-10.

INJURIES

Bills running back Travaris Cadet was carted off the field late in the second quarter because of a right ankle injury. …Buffalo safety Micah Hyde left the game after being shaken up in the third quarter. … Bills cornerback Shareece Wright was shaken up in the fourth quarter but walked off on his own power.

RARE MISTAKE

The interception return for a score thrown by Brady was his first since he was intercepted by Robert Alford in last season’s Super Bowl win. Brady’s last regular-season pick six came in Week 13 of 2015 against Philadelphia (Malcolm Jenkins).

DYNAMIC DUO

Brady’s 17-yard TD pass to Gronkowski marked the 75th time they’ve connected for a score – the fifth-most all-time between a QB and a receiver.