The Buffalo Bill strengthened their position at the top of the AFC East as they avoided a third straight defeat with a 23-20 win over divisional rivals the New York Jets.

Aaron Rodgers, who threw for 294 yards, gave the Jets – who fired head coach Robert Saleh last week – hope with a Hail Mary pass for touchdown on the brink of half-time, but they fell to a third consecutive loss.

Opposing quarterback Josh Allen ran for a touchdown in the opening quarter, but Rodgers put the Jets ahead at the end of the period as he connected with Garrett Wilson from five yards, Greg Zuerlein having opened the scoring with an early field goal.

The Bills hit back and looked to be heading to the half-time interval with a healthy lead, Allen connecting with Mack Hollins and – with just 21 seconds left on the clock – Dawson Knox for touchdowns and a 20-10 cushion.

But the Jets hit back as time ran out, Rodgers finding Allen Lazard from 52 yards to cut the gap to three.

That gap was wiped out when Zuerlein landed the only points of the third quarter from 22 yards, but he twice hit the left upright with attempts to put them ahead.

With penalties blighting both sides, they remained level until Tyler Bass – also missed twice – kicked the Bills ahead inside the last four minutes.

Rodgers’ attempt to drive the Jets to a match-winning score in the closing moments ended when he was intercepted by Taron Johnson and the Bills were able to run out the clock.