ORCHARD PARK, N.Y. >> Josh Allen rushed for two touchdowns, Buffalo’s defense forced three turnovers and the Bills advanced to the AFC championship game with a 27-25 win over the Baltimore Ravens in the divisional round on Sunday night.

The Bills hung on when a wide-open Mark Andrews dropped a 2-point conversion pass from Lamar Jackson, allowing the ball to bounce off his chest with 1:33 left. Jackson connected with a sliding Isaiah Likely for a 24-yard touchdown to give the Ravens a chance to tie it.

The Bills advanced to the AFC Championship Game on Sunday against the conference’s top seed, the two-time defending Super Bowl champion Kansas City Chiefs. Buffalo snapped a three-year run of being eliminated in the divisional round.

It’s a familiar matchup for Buffalo, which has been eliminated by Kansas City in three of the past four postseasons.

Allen scored on runs of 1 and 4 yards while Ray Davis also scored on a 1-yard run. Tyler Bass hit both field goal attempts, including a 21-yarder with 3:29 left after the Bills stalled at Baltimore’s 2. That drive was set up by the Ravens’ final turnover, when linebacker Terrel Bernard stripped the ball from Andrews at the Buffalo 44.

The Bills closed their season a perfect 10-0 at home. That included a 30-21 win over the previously unbeaten Chiefs in Week 11.

The Ravens had one of the NFL’s most productive offenses in the regular season but fell a win short of reaching the conference title game, which they lost to the Chiefs a year ago. Scrutiny of Jackson’s playoff performances will only increase as he fell to 3-5 in the postseason. He had two first-half turnovers in this loss, throwing an interception and losing a fumble.

Baltimore fell to 5-8 in the divisional round, including 1-4 in its last five.