OAKLAND, Calif. — Rookie Derek Carr gave the Oakland Raiders something to celebrate for a change.

Carr threw a 9-yard touchdown pass to James Jones with 1:42 remaining Thursday night, and the Raiders snapped a 16-game losing streak with a 24-20 victory against the Kansas City Chiefs.

“I’ve been through a lot of hard times; these losses have been hard,” Carr said.

Latavius Murray of Oakland ran for two touchdowns on 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 their first win since beating Houston on Nov. 17, 2013.

Alex Smith threw two TD passes for the Chiefs (7-4), who had won five straight. They fell a half-game behind Denver in the AFC West.

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.

The Chiefs will have a long time to stew over this loss before hosting Denver on Nov. 30 in an AFC West showdown.

It took an 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.

“That was really hard-fought. They are a great team obviously, they will probably go to the playoffs and do some great things,” Carr said. “I can’t wait to see my teammates’ smiles.”

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.

The Chiefs battled back from a 17-3 deficit late in the third quarter to take the lead with three scores in less than eight 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 beat Charles Woodson out of the backfield to catch a short pass and weaved through Oakland’s defense 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 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 offense 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.

NOTES

CARDINALS: Receiver Larry Fitzgerald said his injured left knee is “a little bit better” and he “remains optimistic” he’ll be able to play Sunday when the Cardinals are at Seattle.

THE NFL Players Association told the federal judge hearing a lawsuit against the league that the collective bargaining agreement did not provide a way for the union to press claims by former players that NFL teams routinely mishandled painkillers.

BILLS: Buffalo was awarded the right to claim tight end MarQuies Gray.

JAGUARS: Justin Blackmon, a suspended receiver, pleaded no contest to one misdemeanor count of marijuana possession in Oklahoma.

BEARS: A Soldier Field spokesman said the game clocks that malfunctioned during last weekend’s game between Chicago and Minnesota were repaired.

TITANS: Tennessee promoted linebacker Justin Staples to the roster from the practice squad and filled that spot by signing linebacker Yawin Smallwood.