Josh Allen and the Buffalo Bills held off the charging Miami Dolphins and won their wild-card matchup Sunday, 34-31, at Highmark Stadium.

Allen needed two touchdown passes in the third quarter and to stop the miscues to get back on top after going up 17-0 early in the second quarter. The Buffalo defense also had to put a stop to a rallying Miami offense that was making big plays down the stretch.

The star quarterback finished 23 of 39 with 352 passing yards and three touchdown passes. He also had two interceptions and lost a fumble that resulted in a touchdown. Two Buffalo wide receivers were over 100 yards receiving as well.

CLICK HERE FOR MORE SPORTS COVERAGE ON foxnews.1eye.us

Matt Milano vs the Dolphins

Buffalo Bills linebacker Matt Milano (58) reacts during the first half of the wild-card playoff game against the Miami Dolphins, Sunday, Jan. 15, 2023, in Orchard Park, New York. (AP Photo/Jeffrey T. Barnes)

Stefon Diggs had seven catches for 114 yards. Gabe Davis had six catches for 113 yards and a touchdown. Devin Singletary led Buffalo with 41 yards on the ground on nine carries.

On the other side, Dolphins quarterback Skylar Thompson had 220 yards on 18-of-45 passing. He had a touchdown pass and two interceptions. Tyreek Hill had seven catches for 69 yards and Salvon Ahmed had three catches for 4 yards. 

The Bills got out to a hot start.

Allen found tight end Dawson Knox for a 6-yard touchdown to go up 7-0 early. It was the fifth straight game with a touchdown catch for Knox. He joined Eric Moulds, Steve Johnson and Lee Evans for the most consecutive games of at least one receiving touchdown in team history, according to ESPN Stats & Info.

Running back James Cook would put the Bills up 14-0 with a 12-yard touchdown run. Cook finished with 39 rushing yards. 

Buffalo got off to a good start in the second quarter with a Tyler Bass 33-yard field goal to go up 17-0. Before the half was over, Miami would start their run.

Skylar Thompson calls a play

Miami Dolphins quarterback Skylar Thompson (19) signals during the first half against the Buffalo Bills, Sunday, Jan. 15, 2023, in Orchard Park, New York. (AP Photo/Adrian Kraus)

The Dolphins got three consecutive field goals from Jason Sanders to cut the lead to eight points. Thompson would then find Mike Gesicki for a 7-yard touchdown pass, and a two-point conversion would tie the game up.

BILLS' JOSH ALLEN INVOLVED IN SKIRMISH WITH DOLPHINS' CHRISTIAN WILKINS IN PLAYOFF GAME

Gesicki would finish with two catches for 15 yards.

Buffalo would answer with another Bass field goal and took a three-point lead into the half.

The Dolphins briefly took the lead in the third quarter thanks to an Allen fumble. The quarterback lost the ball and defensive lineman Zach Sieler was on it. He scooped the football up and returned it for a touchdown, giving the Dolphins a four-point lead. That would be the last time they had it.

Allen would find Cole Beasley for a 6-yard touchdown pass to regain the lead. Then he would throw a dart to Davis on a 23-yard touchdown to get some cushion.

Dolphins running back Jeff Wilson Jr. ran the ball into the end zone for a touchdown to cut the lead to three points. But Thompson couldn’t get Miami to within field-goal range to tie the game up on Miami’s next drive.

The Dolphins would turn the ball over on downs.

Josh Allen and Cole Beasley

Buffalo Bills wide receiver Cole Beasley is congratulated by quarterback Josh Allen after his touchdown catch during the second half against the Miami Dolphins, Sunday, Jan. 15, 2023, in Orchard Park, New York. (AP Photo/Joshua Bessex)

Buffalo is back in the divisional round of the NFL playoffs for the third consecutive season.

CLICK HERE TO GET THE FOX NEWS APP

Miami is still without a playoff win since the 2000 season.