PALO ALTO, Calif. -- Tyler Gaffney churned out 171 yards on 36 carries and the Stanford defense took care of the rest as the No. 13 Cardinal knocked No. 9 UCLA from the unbeaten ranks with a 24-10 victory over the Bruins at Stanford Stadium on Saturday afternoon.
No. 13 Stanford improved to 6-1 overall and 4-1 in the Pac-12 following last week's loss to unranked Utah.
No. 9 UCLA (5-1, 2-1) has more work ahead as it faces Oregon in Eugene, Ore., next Saturday.
Heading into the game, UCLA ranked fifth in the nation in total offense and seventh in scoring, averaging 45.8 points. But the Bruins were shut out in the first half, and their 10 points Saturday were 24 points fewer than their previous season low.
Stanford outgained UCLA 419-266.
UCLA quarterback Brett Hundley, who entered the game ninth in the country in total offense, was 24-for-39 for 192 yards passing, one touchdown and two interceptions, while Stanford's Kevin Hogan was 18-for-25 for 227 yards, one score and one interception.
Jordan Richards had both of Stanford's interceptions, and his pick at the UCLA 32-yard line with 2:40 left sealed the win. Stanford led 17-10 at that point, and Stanford turned it into a touchdown on Gaffney's 4-yard scoring run with 1:42 to make it 24-10.
UCLA trailed 3-0 at halftime, but tied the game on a 38-yard Ka'imi Fairbairn field goal that completed a 54-yard drive to start the third quarter.
However, Stanford regained the lead on an outstanding one-handed touchdown catch by Kodi Whitfield. A 29-yard pass to Ty Montgomery set of the scoring play, which came on a second-and-18 play from the UCLA 30-yard line. Hogan launched a pass into the end zone, and Whitfield leaped high and reached up with his right hand to pluck the ball out of the air for a touchdown to make it 10-3.
A Richards interception set up the Cardinal's next score, giving Stanford the ball at the UCLA 40-yard line after a holding penalty on the interception return negated Richards' run for a touchdown.
Gaffney carried over from the 1-yard line with 3:33 left in the third quarter to give Stanford a 17-3 lead.
UCLA closed the gap to 17-10 on Hundley's 3-yard pass to Shaq Evans on the first play of the fourth quarter, ending a 75-yard drive.
Stanford's Conrad Ukropina missed a 46-yard field-goal attempt with 6:24 to go to keep UCLA in the game, but the Bruins could not generate any more offense.
Stanford had dominated the first half statistically, but led just 3-0 at intermission.
Stanford outgained the Bruins 207-84 over the first two quarters and had 14 first downs to five for the Bruins. Hundley was just 5-for-10 for 37 passing yards at halftime.
The only first-half score came late in the first quarter after a 74-yard Stanford drive led to a 31-yard field goal by Ukropina.
The Cardinal threatened late in the second quarter, getting as far as the UCLA 23-yard line. But Hogan threw a pass that popped out of the hands of wide receiver Devon Cajuste and into the arms of UCLA defensive back Ishmael Adams for an interception at the UCLA 6-yard line.
NOTES: UCLA RB Jordon James, who is averaging 115.8 rushing yards per game this season, missed his second straight game Saturday because of an ankle injury. ... Stanford WR Devon Cajuste left the game in the third quarter with a lower leg injury. ...UCLA LB Eric Kendricks left the game with an undisclosed injury in the first half and did not return. ... Stanford PK Jordan Williamson sat out the game with an undisclosed injury. Ukropina took his place and made his first appearance in a college game. ... Stanford had won 12 straight home games before Saturday's game. It represented the third-longest active home winning streak in the country.