SANTA CLARA, Calif. -- Southern California overcame a midseason coaching change, three losses in four games and numerous injuries to make it to the Pac-12 title game.

The Trojans just couldn't overcome Christian McCaffrey and Stanford to end this turnaround season in the Rose Bowl.

McCaffrey ran for 207 yards and a score, threw a touchdown pass, caught another and broke Barry Sanders' single-season all-purpose yards record to lead No. 7 Stanford to the Pac-12 championship with a 41-22 victory over No. 24 Southern California on Saturday.

"He's as special a player as we've played all season," USC coach Clay Helton said. "His ability to break tackles is what stood out today. We talked about tackling him all week and we were going to have to. He's just one of those kids that finds ways to make yards."

The loss by the Trojans (8-5, No. 20 CFP) caps an emotional week that started with Helton having the interim tag removed two months after replacing Steve Sarkisian and ended with USC falling short of returning to the Rose Bowl for the first time since the 2008 season.

"We've been through so many tough times, and I'll look back -- right now it hurts -- but I'll look back some day and be proud of the person I

became and the players I got to play with," said quarterback Cody Kessler, who came to USC when the school was on probation and played for four coaches in his career.

Kessler threw for 187 yards and a touchdown and ran for another score as USC rallied from a 13-0 deficit before McCaffrey and Stanford's defence took the game over for the Cardinal (11-2, No. 7 CFP).

After blowing an early 13-point lead, the Cardinal faced a third-down in their own territory. Kevin Hogan then found McCaffrey open in the middle of the field and he ran with for a 67-yard reception down to the USC 7. Hogan ran it in on the next play to put Stanford back on top.

"I think 99 per cent of the matchups he has out the back field on the one-on-one, he's going to win it," linebacker Su'a Cravens said. "He got to the inside and took it down to the red zone. They had a perfect play call for their defence."

Blake Martinez, playing in a bum ankle, then sacked Kessler and caused a fumble on the next possession that Thomas scooped up and ran in for the score that made it 27-16.

After USC scored to make it a one-possession game, McCaffrey put the capper on another Stanford win with a 27-yard touchdown reception when he was left wide open in the middle of the field.

McCaffrey added 105 yards receiving and 149 return yards to give him a Stanford record 461 all-purpose yards for the game and 3,496 for the season. That broke Sanders' single-season record of 3,250 yards set in 1988, although McCaffrey took two extra games to do it.

"That's a guy I had posters on my wall of growing up," McCaffrey said. "Even to be mentioned in the same category is definitely an honour."

Hogan caught the TD pass from McCaffrey, threw one and ran for a third and Solomon Thomas scored on a 34-yard fumble return for the Cardinal. Stanford will play in the Rose Bowl as Pac-12 champion after losing an outside chance to make the four-team playoff when No. 1 Clemson held off North Carolina in the ACC championship.

"If the worst thing we do is go to the Rose Bowl, I think that's pretty cool," Shaw said. "We're not in charge of that. We'll go where they tell us to go."

After being thoroughly outplayed for the first 25 minutes, the Trojans got right back into the game with three straight scoring drives. Kessler led a 15-play drive in the closing minutes of the half to lead to a 40-yard field goal by Alex Wood that cut Stanford's lead to 13-3.

Kessler then threw a 1-yard TD pass to Jahleel Pinner to open the third quarter to cut it to 13-9 and Ronald Jones II scored on a 27-yard run on the next possession to give the Trojans their first lead at 16-13.

It didn't last long.

"I reminded them in that locker room just to remember what this pain feels like, because it's our goal next year to be right back here next year, and I want them to remember how bad this hurts," Helton said. "If it doesn't hurt, something's wrong. What I see in there is a bunch of sad kids that want this more than anything."