Denny Medley-USA TODAY Sports

Josh Allen accounted for two touchdowns and Tyler Bass kicked the tiebreaking 39-yard field goal to help the Buffalo Bills post a 20-17 victory over the host Kansas City Chiefs on Sunday.

Bass' boot went through the uprights with 1:54 remaining as the Bills (7-6) won for just the third time in their past seven contests. James Cook had a receiving touchdown and 141 scrimmage yards (83 receiving, 58 rushing) for Buffalo.

Patrick Mahomes completed 25 of 43 passes for 271 yards, one touchdown and one interception as the Chiefs (8-5) lost for the fourth time in six games. Travis Kelce had 83 yards on six receptions, Rashee Rice had seven catches and 72 yards and a score and Jerick McKinnon rushed for a touchdown.

High-powered Kansas City has scored 21 points or fewer in five of its last six games.

The contest was Buffalo's fifth visit to Kansas City in 34-plus months. The Bills won all three regular-season games but lost both playoff appearances during the span.

Allen completed 23 of 42 passes for 233 yards with an interception.

The Chiefs appeared to go ahead on a 49-yard passing touchdown with 1:12 left when Mahomes hit Kelce for 24 yards and the star tight end passed the ball laterally to Kadarius Toney, who ran the final 25 yards.

But the score was nullified because Toney lined up in the neutral zone.

After Kansas City turned the ball over on downs with 55 seconds left, Mahomes was vehemently angry on the sideline, slammed his helmet on the ground and was yelling non-stop.

Buffalo led 17-7 after a 10-play, 62-yard drive to open the second half netted a 31-yard field goal by Bass.

Kansas City answered with a nine-play, 75-yard excursion that resulted in Mahomes' 4-yard scoring toss to Rice with 3:30 left in the period.

The Chiefs knotted the score at 17 when Harrison Butker booted a 27-yard goal with 11:31 left in the fourth quarter.

Allen passed for one touchdown and rushed for another as the Bills held a 14-7 halftime lead.

Allen connected with Cook on a 25-yard scoring pass with 3:43 left in the opening quarter. Buffalo made it 14-0 on Allen's 6-yard run with 11:50 left in the first half.

The Chiefs finally got on the board when McKinnon scored on a 7-yard run with 1:19 left in the half.

More must-reads:

TODAY'S BEST
Mets release veteran infielder
Anderson Silva, Chael Sonnen will finish off their trilogy in a boxing ring
Victor Wembanyama, Chet Holmgren highlight 2023-24 All-Rookie team
Jaguars' Doug Pederson discusses Trevor Lawrence contract extension
Saints, star CB 'moving forward' following trade chatter
Pacers ride historic shooting performance to Game 7 blowout of Knicks
Timberwolves mount incredible second-half comeback to stun Nuggets in Game 7
Xander Schauffele proves doubters wrong with historic win at 2024 PGA Championship
Four things we learned from Joey Logano's All-Star Race win at North Wilkesboro
Phil Foden lifts Manchester City to fourth consecutive English Premier League title
Watch: Aaron Judge blasts 13th home run in Yankees' seventh straight win
Canucks won't have linchpin forward for Game 7 vs. Oilers
Jags reportedly mulling extension for Trevor Lawrence, but is that the right choice?
Gordon Hayward calls role with Thunder 'frustrating'
Mets reliever Edwin Diaz showing short shelf life of closers
Three offseason moves the 49ers must make
Watch: NASCAR drivers exchange punches after crash in All-Star Race
Knicks star offers passionate defense of HC Tom Thibodeau after Game 7 loss
Knicks' Jalen Brunson suffers serious injury in Game 7 vs. Pacers
Dodgers add recently acquired left-hander to active roster

Want more NFL news?

Join the hundreds of thousands of fans who start their day with Yardbarker's Morning Bark, the best newsletter in sports.