MEXICO CITY — The Kansas City Chiefs did a lot of bending but ultimately did not break against the Los Angeles Chargers at Estadio Azteca in Mexico City on Monday Night Football.

Kansas City was outplayed early in the game and had to overcome the Chargers outproducing them 312-109 net yards in the first half, a period where the Chargers ran 43 plays to the Chiefs' 23.

The Chiefs would eventually get going in the second half, but then they had to sweat out a last-minute frenzy from the Chargers to secure a 24-17 win and improve to 7-4 in the thin air of Mexico City.

"There's not a lot of oxygen," Chiefs coach Andy Reid said. "But it's good oxygen. ... We used every bit of it, I think, towards the end there."

The loss dropped the Chargers to 4-7, three games behind Kansas City in the AFC West.

Kansas City's offense shook off a sluggish first-half start, which included two penalties, by holding the Chargers to just nine points after Los Angeles made four drives deep into Chiefs territory.

"We shot ourselves in the foot a couple of times with some penalties," Chiefs center Austin Reiter said. "I think that partly sums it up pretty well."

Kansas City's defense stepped up and limited the Chargers to three field goals in the first two periods, recording two interceptions off Chargers signal-caller Philip Rivers, who finished the game with 353 yards passing and a touchdown but also four picks.

Chargers coach Anthony Lynn bemoaned his team's missed opportunities.

"You got to get the ball in the end zone," Lynn said. "Kicked too many field goals in the first half. Team like Kansas City, you can't kick field goals. You've got to score. I felt like we let them hang around."

Chiefs safety Tyrann Mathieu snared one interception in the first half and defensive tackle Derrick Nnadi recorded the other to help the Chiefs take a 10-9 halftime lead in spite of 199 first-half total yards by Chargers running backs Melvin Gordon and Austin Ekeler.

After the defense kept the game close in the first half, quarterback Patrick Mahomes flipped the switch in the second half.

He had completed just 8 of 15 passes for 63 yards and an interception for a 36.3 passer rating at halftime. But he finished the game completing 19 of 32 passes for 182 yards and a touchdown for a 72.7 passer rating. And he alleviated any lingering concerns about his knee by rushing for a team-high 59 yards on five attempts.

The reigning league MVP didn't have his full deck of offensive weapons after wide receiver Tyreek Hill suffered an early hamstring injury. Running back Damien Williams later suffered a rib injury, and backfield mate LeSean McCoy wound up in the locker room, too, with a possible concussion.

Hill was hurt while running a deep route in the first quarter. The pass fell incomplete and Hill went straight to the sideline grabbing at his right hamstring. After receiving some attention on the trainer's table, Hill put on his helmet and returned to the sideline. But when the offense took the field, Hill went to the locker room. He later came back to the field but did not return to the game.

Williams suffered the rib injury shortly before halftime and did not return to the field to begin the second half. The Chiefs eventually ruled out Williams midway through the third quarter.

Others helped picked up the slack.

Tight end Travis Kelce, who had just one catch for 31 yards on two targets in the first half, energized the passing game in the second half with a 23-yard touchdown grab in the third quarter. Kelce finished the game with seven catches for 92 yards receiving and a touchdown on 10 targets.

McCoy helped overcome the loss of Williams by rushing for 29 yards and a touchdown on seven carries before leaving the game. Darrel Williams chipped in 35 yards rushing and a touchdown on 11 carries. McCoy added four catches for 28 yards on six targets.

Mathieu dropped what should've been an interception late in the third quarter, and Rivers made the Chiefs pay four plays later with a touchdown throw to wide receiver Keenan Allen. The drive was also kept alive by safety Daniel Sorensen's pass interference penalty, and the Chargers pulled within seven, 24-17, after Rivers hit tight end Hunter Henry for the 2-point conversion.

The Chiefs' defense, however, ensured the Chargers wouldn't pull off a win by producing big plays down the stretch.

"Huge, man," Chiefs linebacker Reggie Ragland said of the defensive effort. "We got the stop at the end in divisional play. We needed that the way we've been up and down lately."

Defensive end Frank Clark was key in the fourth quarter with a sack on Rivers to end a Chargers possession. He also had a bone-crushing hit on Ekeler to to help stop another drive. Cornerback Rashad Fenton intercepted Rivers with less than four minutes remaining in the game.

And Sorensen made up for his pass interference penalty with a game-sealing interception.

"That was epic," Reiter said. "Dirty Dan getting the interception at the end of the game, I mean, that was perfect."

Sorensen allowed some emotions to come out after his pick, celebrating in emphatic fashion by holding the ball up in triumph.

"It's an emotional game," Sorensen said. "That was a fight. They're a good team and it came down to the wire."

The Chiefs now enter their bye week with a half-game lead over the Oakland Raiders (6-4). Those two teams will meet in a game with divisional implications Dec. 1 at Arrowhead Stadium.