Kansas City Chiefs wide receiver Donnie Avery (17) catches a pass while covered by San Diego Chargers cornerback Derek Cox (22) during the first half of an NFL football game at Arrowhead Stadium in Kansas City, Mo., Sunday, Nov. 24, 2013. San Diego Chargers running back Ryan Mathews (24) dives for a first down between Kansas City Chiefs defenders during the first half of an NFL football game at Arrowhead Stadium in Kansas City, Mo., Sunday, Nov. 24, 2013. AP Photo/Ed Zurga Kansas City Chiefs running back Jamaal Charles (25) scores a touchdown over San Diego Chargers free safety Eric Weddle during the first half of an NFL football game at Arrowhead Stadium in Kansas City, Mo., Sunday, Nov. 24, 2013. San Diego Chargers running back Ryan Mathews (24) fumbles when hit by Kansas City Chiefs inside linebacker Akeem Jordan (55) and strong safety Eric Berry (29) during the first half of an NFL football game in Kansas City, Mo., Sunday, Nov. 24, 2013. The Chargers recovered the ball on the play. Referee Walt Coleman wears a headset to review a play during the first half of an NFL football game between the San Diego Chargers and the Kansas City Chiefs at Arrowhead Stadium in Kansas City, Mo., Sunday, Nov. 24, 2013. (AP) - Philip Rivers came through when the San Diego Chargers needed him the most. The once-embattled quarterback threw for 392 yards and three touchdowns, the final one a 26-yarder to Seyi Ajirotutu with 24 seconds remaining, to give the Chargers a 41-38 victory over the Kansas City Chiefs on Sunday and end a three-game losing streak. The Chiefs had taken the lead when Alex Smith hit Dwayne Bowe for a go-ahead score with 1:22 left. But the Chargers (5-6) still had two timeouts, and they used both to quickly move downfield. Ajirotutu's TD in tight coverage was just his third catch of the season. It also represented the eighth and final lead change in the game. Smith threw for 292 yards and three touchdowns for the Chiefs, who dropped their second straight after a 9-0 start. They also lost top pass rushers Tamba Hali and Justin Houston to injuries and now have to turn their attention to the Denver Broncos next week. Jamaal Charles added 115 yards rushing and two touchdowns. Donnie Avery had four catches for 91 yards and a score as Kansas City produced its best point total of the season. It still wasn't quite enough. Danny Woodhead had touchdowns rushing and receiving as he picked up the slack for Chargers running back Ryan Mathews, who left with a hamstring injury. Ladarius Green had a 60-yard touchdown reception in the fourth quarter, while Keenan Allen had nine catches for 124 yards. San Diego finished with 491 yards of offense against a Chiefs defense that had allowed more than 17 points just once: last week's 27-17 defeat in Denver. Hali rolled his right ankle and was taken to the locker room on a cart and did not return. The Chiefs lost their other pass rusher later in the first half, when Houston was banged into during a scrum and left holding his right elbow. The game turned into a back-and-forth nail-biter in the second half. San Diego pulled ahead 17-14 when a 54-yard pass to Eddie Royal set up a 1-yard TD run by Mathews. But the Chargers helped the Chiefs take the lead right back with three pass interference penalties that gave them the ball at the San Diego 1. Charles' second touchdown made it 21-17. The Chargers' embattled defensive backfield got one back on the Chiefs' next series. Shareece Wright, who had one of those pass interference penalties, batted a pass to Marcus Gilchrist, who had one of the others. The interception set up Woodhead's 3-yard touchdown run. Kansas City retook the lead at 28-24 on Smith's short touchdown pass to Anthony Fasano, but after the teams traded chip-shot field goals early in the fourth quarter, the Chargers took it right back. Rivers hit Green on a quick slant route, and the tight end ran 60 yards for his first career touchdown. It gave the Chargers a 34-31 lead with 7:50 left in the game. The Chiefs answered the call, only for the Chargers to trump them in the end.