KANSAS CITY, Mo. (AP) — In a never-say-die showdown between two of the NFL’s top teams, and two of its bright young quarterbacks, the Bills and Chiefs played a classic Sunday night decided by one of them calling tails and the other making him pay for it.

Josh Allen’s decision on the overtime coin toss was his only mistake for Buffalo all night.

Patrick Mahomes promptly followed it by marching Kansas City downfield against the NFL's top-ranked but exhausted defense, then finding Travis Kelce in the corner of the end zone from 8 yards, giving the Chiefs a memorable 42-36 victory — and never giving his burgeoning rival an opportunity with the ball.

“It worked out well for us this time,” said Mahomes, who has his team playing in its fourth consecutive AFC title game. “When you have two teams going back and forth, it stinks when you don't get to see the other guy go. But all you can do is play the rules the way the rules are explained, and that's what we did.”

Did it perfectly, too, setting up a showdown next Sunday against Cincinnati for another trip to the Super Bowl.

“The guys didn’t flinch,” Chiefs coach Andy Reid said “You talk about an epic game, well, that’s the way the players took it. They had tremendous respect for Buffalo and they knew it was going to be a battle and they kept going.”

What was Reid’s advice for Mahomes down the stretch?

“When it’s grim, be the grim reaper, and go get it,” Reid said. “He made everyone around him better.”

The lead changed hands three times in the final two minutes of regulation, and there were 25 points scored over that stretch. Harrison Butker, who earlier had missed a field goal and extra point, drilled a 49-yarder as time expired to force the extra session, and when the Chiefs won the coin toss, Mahomes took care of the rest.

He finished with 378 yards passing and three touchdowns, including a 64-yarder to Tyreek Hill during the thrilling final minutes of regulation and the clutch throw to Kelce that sent players streaming off the bench.

“We got tremendous leaders on both sides of the ball, whether it's offense, defense or special teams,” Hill said. “Nobody panicked. Nobody was like, ‘Oh, the game is over, there’s 13 seconds left.' We just made plays.”

Allen did everything he could to prevent another season-ending loss inside Arrowhead Stadium. He threw a go-ahead touchdown pass to Gabriel Davis with 1:54 left in the regulation, then another to Davis — his playoff-record fourth TD catch of the game — with 13 seconds remaining in regulation.

Allen's only mistake? His coin toss call.

He finished with 329 yards passing, and Davis with eight catches for 201 yards, as the Bills lost their ninth straight road playoff game — a streak that includes last year's loss to Kansas City in the AFC title game.

“It’s just tough, you know? To be in that moment again,” Allen said. “It sucks the way it happened, you know? We wanted to win that game. We had opportunities. Just, yeah, taking it all in, holding onto that feeling, and making sure we don’t feel like this again — back-to-back years in the same spot. It’s tough to take in.”

All told, Mahomes and Allen each threw for at least 300 yards and three touchdowns, completed at least 70% of their passes without an interception, and — get this — led their teams with at least 65 yards rushing.

No other quarterback in NFL history has accomplished those feats in a game, regular season or postseason.

“The Chiefs are a good football team. We knew it was going to take a heck of an effort coming out here,” Bills coach Sean McDermott said, “and I thought the guys gave us that effort, starting with Josh and all the way down the line. But those guys are hurt, we’re disappointed — we’re all disappointed, we’re all sick to our stomach. You move on and you try and get yourself to learn from it, but it stings. It stings. I’m not going to sugarcoat it. It stings.”

It was a playoff game for the history books, but the first 58 minutes few will remember.

The final two minutes and overtime, few will forget.

The Chiefs were leading 26-21 when Allen, who had been nearly perfect all night, connected with Davis for the third time in the game — a fourth-and-13 dart finished off a 17-play, 75-yard drive and gave the Bills the lead.

Not to be outdone, the Chiefs answered when Mahomes found Hill over the middle. The fleet-footed wide receiver ran away from cornerback Levi Wallace for a 64-yard touchdown that gave Kansas City the right lead back.

Then it was the Bills’ turn again: Allen threw a 28-yard pass to Davis, hit him again for 12 yards, then found Emmanuel Sanders along the sideline to give McDermott’s team a chance with 17 seconds on the clock.

Allen hit Davis right between the numbers, their 19-yard strike giving him the postseason-record — but not the victory.

That's because Mahomes wasn’t done conjuring up playoff magic. He found Hill for 19 yards, then hit Kelce for 25 more on a schoolyard-style play, giving Butker a chance to try a 49-yarder into a slight, chilly breeze as time expired.

Naturally, it split the uprights.

Overtime.

A fitting way to end a divisional-round weekend filled with last-second heroics.

“Yeah, obviously not the way we wanted to end our season,” Bills safety Jordan Poyer said. “Man, the offense did everything they had to do. Defense, we had to go out there and make a stop, weren’t able to do it. It’s just a tough feeling, man. Just a really tough feeling, hard to put in words. It sucks. It’s something we’ve got to live with.”

INJURIES

Bills: CB Micah Hyde left with an undisclosed injury he sustained on the final play of regulation.

Chiefs: Tyrann Mathieu left on the opening drive with a concussion after the Pro Bowl safety was hit by teammate Jarran Reed’s knee. ... CB Charvarius Ward was hurt trying to tackle Allen with 5 1/2 minutes left in the game.

UP NEXT

The Chiefs get a visit from Cincinnati next Sunday, becoming the first franchise in NFL history to host four consecutive conference championship games. The 49ers play the Rams for the NFC title in the nightcap.

___

More AP NFL coverage: https://apnews.com/hub/nfl and https://twitter.com/AP_NFL