STANFORD, Calif. (AP) Dorian Thompson-Robinson wasn't sure he was going to start Thursday's game until just before game time. It turned out to be the best decision of the night.

Thompson-Robinson, using the bye week to help his recovery from a leg injury that caused him to miss a game, passed for two touchdowns and ran for another in helping UCLA end an 11-year drought against Stanford with a 34-16 victory over the Cardinal.

''I was day-to-day until tonight,'' Thompson-Robinson said. ''I had been practicing but I was told just before game time.''

Thompson-Robinson passed for 192 yards and rushed for 66 as UCLA snapped an 11-game losing streak to the Cardinal, dating to 2008. Joshua Kelley rushed for 176 yards, including a 54-yard touchdown run and a 53-yard gain. Kyle Phillips caught 10 passes for 100 yards and a pair of touchdowns.

''A win is always good,'' Thompson-Robinson said. ''It goes back to getting together in the offseason and working on things like this.''

Jack West became Stanford's third different starting quarterback of the season, the first time that's happened since 1974. After early success, his inconsistent play led to a stalled offense.

''I'm always preparing to be the guy and this week happened to be the game,'' West said. ''It's me making my first start but at the end of the day, it's about execution, which is what we didn't have.''

The Bruins (2-5, 2-2 Pac-12) scored touchdowns on their first two possessions, both passes to Phillips, to open a 14-3 lead with 4:48 remaining to play. It was UCLA's first lead of more than seven points this season.

''I've seen that since the Washington State game,'' UCLA coach Chip Kelly said. ''Dorian kept drives alive with his legs. He takes what the defense gives him.''

Stanford (3-4, 2-3) took the opening kickoff and drove 51 yards before Jet Toner connected on a 42-yard field goal. Toner suffered an apparent right knee injury on the ensuing kickoff and did not return. Punter Ryan Sanborn took over the kicking duties.

Thompson-Robinson was UCLA's leading rusher in the first quarter, helped by a 39-yard scramble that led to the Bruins second score.

The Cardinal, meanwhile, lost 8 yards combined on their next three possessions as West was sacked on three consecutive third downs.

''It starts with good coverage and a good pass rush,'' Kelly said. ''We did a good job of creating pressure on the quarterback. It's not often you can hold Stanford under 200 yards.''

Stanford's Brycen Tremayne fell on a blocked punt in the end zone to make it 14-10. Spencer Jorgensen got his left hand on the punt.

The UCLA defense sacked West seven times, five in the first quarter. The Bruins had nine total sacks over their first six games. Stanford allowed 13 in its first six.

''The defense was a big part of a whole team effort,'' Thompson-Robinson said.

JJ Molson added field goals of 43 and 49 yards in the third quarter. UCLA outgained the Cardinal by a 455-198 margin.

Stanford's Cameron Scarlett rushed for 34 yards, including a 6-yard touchdown run. West was 15 of 32 for 143 yards. He passed for 38 yards on Stanford's first drive.

''It came to me having to play better,'' West said. ''There's a lot I can learn from.''

THE STREAK

Chip Kelly made it a point to downplay the 11-game losing streak to Stanford. Thompson-Robinson said he didn't know about it until after the game. Phillips said he was aware, but nonchalant about it.

''I knew about it, but this is a different team than the ones who lost those games,'' Phillips said. ''We didn't care that much.''

Said Kelly: ''Even when you lose a game you can have success. That's part of the learning process. You can have positive momentum all the time.''

THE TAKEAWAY

UCLA: Any win is good, especially one that ends a long losing streak. It's the fifth win of Chip Kelly's 18-game reign in Pasadena. The much-maligned defense (allowing an average of 431 yards) played well enough to raise the team's hopes with a handful of winnable games coming up. Thompson-Robinson was clearly the best athlete on the field.

Stanford: Down to its third quarterback, the Cardinal simply could not produce enough offense in an offensive-minded conference. Injuries along the offensive line have taken their toll, with junior center Drew Dalman the only lineman to make every start. Unless one of the other quarterbacks can return, Stanford may very well miss a bowl game for the first time in 11 years.

UP NEXT

UCLA: Hosts No. 17 Arizona State on Oct. 26.

Stanford: Hosts Arizona on Oct. 26.

Copyright 2019 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.