The Kansas City Chiefs overcame a sluggish offensive performance Sunday to clinch the No. 1 seed and homefield advantage in the AFC playoffs by edging the visiting Atlanta Falcons, 17-14.

Patrick Mahomes completed 24 of 44 passes for 278 yards with two touchdowns and one of the Chiefs’ two interceptions against an Atlanta defense that came in ranked 31st in the NFL against the pass.

Mahomes’ 25-yard touchdown strike to Demarcus Robinson with 2:01 remaining proved to be the game-winner that enabled Kansas City (14-1) to set a franchise record for regular season wins.

Atlanta (4-11) put Younghoe Koo in position for a 39-yard field goal to force overtime but the Pro Bowl kicker missed with 9 seconds remaining. Before the misfire, Koo had made 35 of 36 field goals this season.

Matt Ryan completed 27 of 35 passes for 300 yards and two scores, including a 5-yard touchdown to Laquon Treadwell with 4:33 left for a 14-10 lead. Calvin Ridley finished with 130 yards on five receptions.

Despite 38 game-winning drives for his career, Ryan remains without such a march this season.

Travis Kelce grabbed seven receptions for 98 yards, including two grabs on the Chiefs’ game-winning drive. With 1,416 yards, Kelce broke George Kittle’s NFL single-season record (1,377 in 2018) for receiving yards by a tight end.

Tyreek Hill added four catches for 65 yards, though the Chiefs’ string of 28 games with at least 20 points was snapped.

The teams each posted five first downs and minimal yardage on their first three series before some Chiefs trickery backfired. Atlanta’s Keanu Neal intercepted a halfback pass thrown by Sammy Watkins and intended for Mahomes.

Although the fourth-down pick gave the Falcons possession on their 2, they drove 98 yards to go up 7-0 with 3:35 left in the first half. A 54-yard pass from Ryan to Ridley set up a 5-yard shovel score from Ryan to Hayden Hurst.

Kansas City forged a 7-7 halftime tie with a 78-yard drive Kelce capped with a 4-yard touchdown pass from Mahomes. On that drive, Kelce became the first NFL tight end to record multiple seasons with 100-plus receptions.