OAKLAND, Calif. -- After 368 days and 16 straight losses, the Oakland Raiders finally had something to celebrate.

Rookie Derek Carr threw a 9-yard touchdown pass to James Jones with 1:42 remaining, and the Raiders got one last defensive stop to snap a 16-game losing streak with a 24-20 victory over the Kansas City Chiefs on Thursday night.

"Hopefully there's many more to come because I like this feeling better than the other one, that's for sure," Carr said.

Oakland's Latavius Murray ran for two touchdowns and 112 yards on just four carries before leaving the game with a concussion. The Raiders (1-10) built a 14-point lead, but needed a 17-play, 80-yard drive led by Carr to secure its first win since beating Houston on Nov. 17, 2013.

"We learned something today," interim coach Tony Sparano said. "We learned something about ourselves. We've been in this end of the pool a long time. I kept saying that eventually it's going to happen. Today they just refused to give up."

The Raiders became just the third team since the merger to beat a first-place team for their first win after losing at least 10 games to start the season. Indianapolis did it against Green Bay in 1997 and Buffalo did it to Dallas in 1984.

Alex Smith threw two TD passes for the Chiefs (7-4), who had won five in a row. They fell a half-game behind Denver in the AFC West. The Chiefs will have a long time to stew over this loss before hosting Denver on Nov. 30.

"We knew we were going to be in a dogfight," Chiefs tight end Travis Kelce said. "Prime-time game and they've got the guys, played a lot of tough teams very well."

It took that impressive drive by the rookie Carr to win it. He twice had to sneak for first downs. He also threw an 8-yard pass to Mychal Rivera on third-and-6 and capitalized on a pass interference penalty against Ron Parker on another third down before finding Jones for the go-ahead score.

"To go 17 plays on the winning drive, that's impressive, man," Raiders defensive end Justin Tuck said. "That lets you know a little bit of the moxie of No. 4 (Carr)."

The game wasn't sealed until Smith threw an incomplete pass on fourth-and-13 from his 48. Even that didn't come without a tense moment. Khalil Mack and Sio Moore sacked Smith on third down and celebrated in the backfield while the Chiefs ran up to the line. An angry Justin Tuck had to call timeout as he seethed at his younger teammates.

"I was so caught in the moment," Moore said. "That was an error I have to make sure I clean up."

The Chiefs battled back from a 17-3 deficit late in the third quarter to take the lead with three scores in less than 8 minutes, including a pair of touchdown passes from Smith.

The first came on a looping throw to Anthony Fasano for a 19-yard score with 1:52 remaining in the third quarter.

The Raiders managed to move the ball near midfield before stalling on their next drive, and the Chiefs answered with a four-play, 65-yard drive that was made even more difficult by a pair of holding penalties. Jamaal Charles then beat Charles Woodson out of the backfield to catch a short pass and weaved through Oakland's defence for a 30-yard score that tied it at 17. It was Charles' fifth touchdown catch in his past two games at the Oakland Coliseum.

Frankie Hammond's 28-yard punt return set up Cairo Santos' second field goal of the game, giving the Chiefs their first lead of the night.

The Raiders had started fast behind the little-used Murray, who had just 10 carries in the first 10 games. He spelled starter Darren McFadden on the second drive and provided an immediate spark for Oakland's struggling offence before leaving the game with a concussion.

Murray carried twice on his first drive, sprinting 11 yards around the end for Oakland's first rushing touchdown since Oct. 19 against Arizona. The Chiefs were looking to match the 2011 San Francisco 49ers by becoming the second team ever to allow no rushing touchdowns through 11 games.

"When you line up and it's raining, the weather's no good and they can't throw the ball, you just line up and run the football," Chiefs linebacker Tamba Hali said. "We weren't playing our gaps and it's like a high school football game."

Murray did even better the next time he touched the ball, sprinting 90 yards past the Chiefs defence for the longest run by a Raiders running back since Bo Jackson had a 92-yarder against Cincinnati in 1989. Quarterback Terrelle Pryor had a 93-yard TD run last season against Pittsburgh. Murray's 112 yards rushing on four carries were the most by any player since at least 1960 with five or fewer carries.

NOTES: Former Raiders P Ray Guy was presented his Hall of Fame ring at halftime. ... WR Junior Hemingway (concussion), T Donald Stephenson (shoulder) and DL Kevin Vickerson (calf strain) left with injuries for Kansas City.