ORCHARD PARK, N.Y. (AP)In Josh they trust, or so the saying goes among Bills fans and players in regards to their beloved quarterback.

In five short seasons, Josh Allen has transformed a franchise that had lost much of its relevance since the Jim Kelly era in the early 1990s, into an offensive dynamo and AFC power. Yet another reminder of the integral role the 26-year-old from Firebaugh, California, has played in the Bills’ emergence was on display in the snow Saturday night.

With the AFC East race on the line, and Buffalo one win short of clinching its fourth consecutive playoff berth, Allen showcased his dual-threat skillset and fearless competitive drive to put the offense on his back in rallying the Bills from an 8-point fourth-quarter deficit to a 32-29 victory over the Miami Dolphins.

The outing was far from perfect, especially given how the offense opened the second half slumbering through a five-series stretch, beginning with four punts and ending with Allen losing a fumble, which the Dolphins converted into a field goal.

And yet, Allen regained his poise to oversee Buffalo close the game with consecutive scoring drives covering a combined 161 yards on 22 plays, and capped by Tyler Bass hitting a 25-yard field goal as time expired.

Allen’s fingerprints – and footprints – were all over Buffalo’s fourth win this season decided with a score in the final 64 seconds.

Allen’s 44-yard scamper fueled the tying drive in which the quarterback capped with a 5-yard pass to Dawson Knox and then used every inch of his 6-foot-5 frame to leap over the pile and nudge the ball over the goal line for a 2-point conversion. On the next drive, Allen converted three third-down situations, the last giving Buffalo the ball at Miami’s 13 after Kader Kohou was flagged for pass interference on Isaiah McKenzie.

Allen didn’t back down when being shoved out of bounds on a late hit from linebacker Elandon Roberts. And he made sure to take a jab at the warm-weather Dolphins in his postgame interview by saying he wished it were colder, repeating the words printed on a shirt Miami coach Mike McDaniel wore during practice earlier in the week.

Allen’s combination of being playful and possessed is not lost on his teammates.

”There’s Josh being Josh,” Knox said. ”He’s the best quarterback in the league, the best football player in the league. So any time you got him on your team, you got a chance to win.”

At 11-3, the Bills are enjoying their fourth-straight season with 10 or more wins, tying the franchise record run set from 1990-93. They’re on the cusp of winning their third straight AFC East title, and have the inside track to finish first in the AFC.

In going 25 of 40 for 304 yards, Allen produced his 20th 300-yard outing, and ninth with four TDs passing, in just his 50th start. And he increased his career touchdown total to 171 (133 passing, 37 rushing and one receiving) to tie Dan Marino for most by an NFL player in his first five seasons.

Perhaps Allen’s most compelling play came on a 4-yard touchdown pass to James Cook to close the first half.

With no timeouts and facing first-and-goal with 8 seconds left, Allen let the clock expire as he scrambled right and was two steps from the sideline before hitting Cook in the back of the end zone.

”Yeah, it’s either a really good play or a really stupid play,” Allen said.

Coach Sean McDermott smiled when reminded of what happened.

”He’s lucky he threw a touchdown pass right there,” McDermott said. ”Or else I would have probably flattened his tires.”

No need to worry. Allen’s tires remain pumped.

WHAT’S WORKING

Red-zone offense. In 13 drives inside an opponent’s 20 over the past four games, Buffalo has scored 11 TDs and a game-winning field goal, along with an Allen interception.

WHAT NEEDS HELP

Opening-drive production. The Bills have combined to score 3 points on the opening drive in each of their past nine outings.

STOCK UP

Knox. With Miami focused on limiting Stefon Diggs, Knox had six catches for a season-best 98 yards and a touchdown.

STOCK DOWN

DB Cam Lewis drew an unnecessary roughness penalty for a late hit on punter Thomas Morstead to extend Miami’s drive after a three-and-out at midfield, which led to Tyreek Hill’s 20-yard touchdown catch to put the Dolphins up 26-21 late in the third quarter.

INJURIES

C Mitch Morse sustained the sixth documented concussion of his career. … DE Boogie Basham is nursing a calf injury. … OL Ike Boettger, sidelined since tearing his Achilles tendon last year, was activated from the reserve/physically unable to perform list on Monday.

KEY NUMBER

6-3 – The Bills’ record this season in games decided by 8 or fewer points. Buffalo was 0-6 (including playoffs) last year.

NEXT STEPS

Buffalo is 2-1 against NFC North teams this year, in traveling to play the Chicago Bears on Saturday.

AP NFL: https://apnews.com/hub/nfl and https://twitter.com/AP-NFL