FOXBORO, Mass. — Having slogged all the way back from a three-touchdown deficit, the Buffalo Bills finally took a lead in the fourth quarter.

They kept it for 14 seconds. That’s how long it took New England Patriots rookie TreVeyon Henderson to escape from what should have been a loss and dash for a 65-yard touchdown run to go back on top.

Gillette Stadium quaked in elation. Josh Allen puked on the sideline.

CBS Sports captured the moment on national television, but as bad as it must’ve been for Bills fans to watch from the sofa or a barstool at the neighborhood gin mill, it was more unpleasant here at Gillette Stadium to watch the Bills gag their way down a 21-0 hole deep into the second quarter, 24-7 at halftime.

The five-time defending AFC East champs choked throughout the game — most egregiously in the first half — but swished some Listerine, collected themselves and powered through a 35-31 victory.

James Cook and Dawson Knox scored all the Bills’ touchdowns, while Allen hurled three of them.

After pulling off yet another improbable comeback, Allen and his teammates regurgitated all the cliches that — at least with these Bills — are legitimate mantras about the critical importance of focusing on one play at a time, not blinking, doing your one-11th, remembering you cannot score 21 points on a single drive, not riding the roller coaster.

On the Bills’ sideline, however, Allen’s topsy-turvy stomach didn’t adhere to any bromide. Back in the day, Jim Kelly’s pregame ritual included throwing up. The Hall of Fame quarterback wouldn’t leave the Bills’ locker room until he had. His teammates would wait for it.

Allen is not as punctual. After the grand comeback, he explained he throws up every game and sometimes during. He sounded surprised that the cameras don’t catch him heaving more often.

“I don’t know why I do it,” Allen said. “It just happens. It’s due to nothing else but, like, a weird feeling. I’ve just got to get it out.”

Allen and his wife, actress Hailee Steinfeld, announced this week that she is expecting their first child. Morning sickness is not contagious, but Allen passed along a pair of second-half touchdowns to new father Knox. The tight end and his wife welcomed a daughter this week.

New England would have clinched the AFC East title with a win, but instead suffered defeat after winning 120 straight while leading by at least 17 points. Buffalo remains a game behind in the division standings with three left to play. The Athletic’s playoff simulator calculates Buffalo with a 24 percent likelihood of winning the AFC East.

How is it that cliches for any other team are words that have adhered to the Bills?

“It’s maybe over the course of the season and what we’ve done,” Allen said. “We saw it today. What makes this team this team (is) we’re not out of it.

“We’re going to continue to fight one play at a time. No matter what the score is, if it’s in the third quarter, if it’s in the fourth quarter, whatever it is, if we’ve got a chance and we’ve got the ball, we feel like we like our chances. That’s that.”

New dad Dawson Knox caught two touchdowns against the Patriots. (Brian Fluharty / Imagn Images)

Even the deepest diehard was left to marvel at what Buffalo accomplished, expelling a first half in which the offense couldn’t move downfield and the defense couldn’t get New England off the field aside from crossing the goal line.

The Bills were subjugated in every way through the first half. Mike Vrabel out-coached Sean McDermott. Drake Maye out-quarterbacked Allen. Robert Kraft even out-ownered Terry Pegula, the presence of rapper Travis Scott in the Patriots’ owners’ box ramping up the cool quotient.

Lawyer Milloy, the drought-era Bills safety who won a Super Bowl with the Patriots, was brought back as Keeper of the Light to ring the fog bell atop Gillette Stadium’s lighthouse before the game.

And every time the Patriots score a touchdown, they blare over the Gillette Stadium loudspeakers a Jon Bon Jovi song. The rockstar failed in his bid to buy the Bills, losing out to Pegula in 2014, but by then he’d written a tune for his good pals Kraft and Bill Belichick. With 5:53 until halftime, the Bills already heard “This Is Our House” three times and hadn’t scored a point.

The Bills also listened to the crowd heave well-deserved letters at Maye: “M-V-P! M-V-P!”

Maye, in the first half, completed nine of his 11 throws for 108 yards and rushed four times for 43 yards and two touchdowns. Henderson ran 11 times for 79 yards, including a 52-yard TD run that wouldn’t end up being his longest.

“Our guys, they understand,” McDermott said of what was discussed at halftime. “They have a good feel for when they are and when they’re not playing the way we need to play.

“And I saw Josh as I was kind of bringing everybody up (to break from the locker room), and he looked at me. I just knew he was seeing it like I was.”

Buffalo started the second half with a vengeance, scoring a touchdown on each of its first four possessions while stopping New England on its first two. Buffalo’s defense started with a three-and-out. Tre’Davious White snagged a sensational interception on a Maye arm punt.

“After you get to 21-24, I think that’s when we were fully back on track,” Bills right tackle Spencer Brown said. “Our defense got a punt, gave us a cushion and were able to just run the piss out of the ball and use play-action with them one-dimensional.”

Knox continued to be Allen’s favorite target. Knox caught six passes for 93 yards against the Cincinnati Bengals last week and followed up with three catches for 37 yards and his first two-touchdown game since 2021. Allen’s non-TD strike to Knox was clutch, too: a 19-yard gain on third-and-5 from the Patriots’ 26-yard line right before halftime. Two plays later, Allen found Cook in the left flat for an easy 5-yard TD to make the score 21-7.

Cook also scored a pair of rushing touchdowns in the second half and finished with 22 carries for 107 yards. He rebounded from last week’s performance against the Bengals, in which he fumbled twice within a six-play span, including on the goal line.

With three minutes left in the first half, Allen had completed four of his six attempts for 11 yards and had three carries for 12 yards – zero touchdowns of either kind. Rather putrid. Over the final 33 minutes, Allen was 15 of 22 for 182 yards and three touchdowns and ran five times for 39 yards, not counting three kneeldowns to kill the clock.

“Ending with the ball in our hands,” said Knox, “the best play in all of football: the victory formation.”

Knox claiming that’s the best play is something because he made several big ones. He cradled the ball like a baby for each touchdown celebration. The second TD broke the club record for most by a tight end. Allen delivered a tiny-window missile in the back of the end zone on third-and-goal from 14 to put Buffalo ahead 28-24 with 10:03 to play.

“It’s hard not to be in awe of him,” Knox said of Allen, “just to be a fan, watch what he does with his legs, with his arm.

“That throw, man. It was on me in a second. It was like a 90 mph fastball, and he put it in the perfect place, where the defender wouldn’t get it. It’s just another thing that makes him the greatest player in the world.”

The play that gave Buffalo its first lead evaporated in a flash. The kickoff was a touchback. Henderson took the first-down handoff 65 yards for a touchdown to ignite Gillette Stadium all over again.

That’s when we saw Allen throw up.

He soon trotted back onto the field and orchestrated a seven-play, 65-yard scoring drive for the game’s final points and to tie the Bills’ record for largest road comeback.

“I’ve seen him do it before in the locker room, seen him do it on the sideline before,” Brown said. “Just kind of his thing. Doesn’t shock us at all.

“I mean, puking kind of feels good.”