NASHVILLE, Tenn. (WKRN) — Derrick Henry had three touchdowns and the Titans pulled off a goal line stand in the closing seconds to shock the Buffalo Bills 34-31 Monday night in Nashville.

Jeffery Simmons stuffed Bills quarterback Josh Allen on 4th and inches at the Titans 3 yard line with only 22 seconds to play to preserve the win.

After staking the Bills to a 6-0 lead on a pair of field goals the Titans got a 76 yard touchdown run from Henry and did not punt for the rest of the game. Henry had another 100 yard game finishing with 143 on 20 carries.

Allen threw for 353 yards and 3 touchdowns as the Titans and Bills went back and forth exchanging the lead 8 times in front of a crowd of over 69-thousand at Nissan Stadium. Allen hit Stefon Diggs for a 14 yard score in the 2nd quarter for a 13-7 lead.

The Titans got a 43 yard field goal from Randy Bullock, but that is when the Titans defense turned in a huge play with Kevin Byard picking off Allen and giving the Titans ball at the Buffalo 11. Only 2 plays later Ryan Tannehill had a 4 yard run for a 17-13 Titans lead.

The Bills took a 20-17 lead into the locker room though after Allen hit Cole Beasley for a 29 yard score.

Henry got the lead back for the Titans at 24-23 in the third quarter with a 3 yard touchdown run but that barely lasted four minutes.

With just 27 seconds left in the third quarter Allen hit Tommy Sweeney for a 1 yard TD, the Bills added a 2 point conversion for a 31-24 lead.

In the 4th quarter Bullock added another 38 yard FG to cut Buffalo’s lead to 31-27 and that is when the Titans defense got another big play from Simmons. His sack of Allen put the Bills in 2nd and 17 and ultimately forced a rare punt.

The Titans went right down the field in only 8 plays culminating with Henry’s third touchdown drive of the game, this one from 13 yards out to make it 34-31.

The AFC East-leading Bills drove to the Titans 3 on their final possession and could have sent the game to overtime with a field goal, but instead went for the win — and didn’t execute.

The Bills wanted to go for the win instead of playing for OT, and the fourth down caught Buffalo slightly off guard. Bills coach Sean McDermott said officials initially signaled Allen got the first down on his third-down scramble. McDermott said he talked after the game with referee Clete Blakeman, who told him an official radioed down from the box that Allen had come up short.

“We didn’t get it done,” McDermott said.

Allen, who had converted an NFL-best 24 quarterback sneaks for first downs since 2018, said he didn’t have great footing.

“I was just trying to find a window to get in there, and quarterback sneaks aren’t the funnest play by any means,” Allen said.

With the win the Titans improve to 4-2 and host the Kansas City Chiefs Sunday at Nissan Stadium.

*The Associated Press contributed to this report.