Pasadena – Stanford said it didn’t intend to be a spoiler for UCLA; it wanted to win for itself.

In any event, the Cardinal spoiled the Black Friday party for the No. 9 Bruins with a convincing 31-10 upset win that robbed UCLA of the Pac-12 South title.

Instead, the championship went to the winner of the Arizona-Arizona State game. Stanford, meanwhile, finished with a 7-5 record and a 5-4 Pac-12 mark, certainly improving his prospects for an attractive bowl game.

It was Stanford’s seventh straight win in the UCLA series and its first win over a ranked team this season in six tries. Surprisingly, along with its usual defensive excellence, the Cardinal put on an offensive show.

If you predicted that Kevin Hogan would completely outplay Brett Hundley, go to the head of the class. The Stanford quarterback completed 16 of 19 passes for 234 yards and two touchdowns, without an interception.

Hundley was kept off kilter by a strong Stanford pass rush and a secondary that blanketed his receivers. He was a rocky 17 for 32 for just 146 yards and one touchdown before being relieved by Jerry Neuheisel midway through the fourth quarter.

Hundley was sacked four times, making his rushing total minus-18 yards on six carries.

Playing without leading receiver Ty Montgomery, Stanford outgained UCLA 436-262.

Holding a surprising 21-10 halftime lead, Stanford pushed it to 28-10 early in the third quarter on a 3-yard touchdown run by Remound Wright.

On the drive, Wright ran 27 yards, nicely reversing field after being apparently stopped for a short gain. Hogan followed with a 16-yard scramble, and Christian McCaffrey swept the right side for 29 yards to the UCLA 6.

Things were getting so desperate for UCLA that the Bruins tried a fake field goal. That didn’t work either. Holder Neuheisel tried to connect with Nate Iese, but the lob was picked off by safety Jordan Richards, his fourth interception against UCLA in the last three years.

Stanford accepted the turnover with gratitude and rolled to another score. Hogan connected with Francis Owusu for a 43-yard pickup, setting up a 34-yard field goal by Jordan Williamson that made it 31-10.

UCLA needed less than four minutes to get on the board after the opening kickoff, and the Bruins didn’t even get the ball first. They held Stanford to a three-and-out – a personal foul against tackle Andrus Peat didn’t help – then needed just five plays to score.

Hundley started the drive with a 21-yard pass to Thomas Duarte and ended it with a 15-yard touchdown pass to the same receiver.

A 1-yard plunge by Remound Wright tied it 7-7 after apparent touchdown by Kelsey Young was overturned after a Bruins challenge. Young was judged on the replay to have been down short of the goal line.

A 42-yard field goal by Ka’imi Fairbarn gave the Bruins a 10-7 lead early in the second quarter. UCLA took over at the Stanford 49 after a short punt by Ben Rhyne and moved to the 24, when Hundley threw three straight incompletions. The latter two were caused by a strong Stanford pass rush.

Stanford finally got rolling on a penalty-free possession, a 75-yard drive capped by Hogan’s perfect 22-yard touchdown pass to Michael Rector, putting Stanford up 14-10. Rector gathered the ball in stride for only his second TD catch of the season, beating cornerback Anthony Jefferson.

On the drive Hogan threw a 12-yard pass to Jeff Trojan and a 13-yarder to Devon Cajuste. Francis Owusu picked up 12 yards on a reverse after taking a pitch from McCaffrey.

Stanford struck again before the half was over. A 37-yard Hogan pass to Cajuste, who caught the underthrown ball in the end zone between two defenders, stunned the crowd and gave Stanford a 21-10 lead with 41 seconds left.

Linebacker Myles Jack, trailing Cajuste, lost track of the ball, and Tahaan Goodman was late getting there to help. It was Cajuste’s first touchdown catch since he scored three against Army in the third game of the season.