UCLA freshman quarterback Josh Rosen once again played beyond his years Thursday and stole the spotlight from potential No. 1 overall pick Jared Goff as the Bruins knocked off the No. 20 Golden Bears.

Richard Mackson USA TODAY Sports

Josh Rosen threw a school-record 34 completions and threw two of his three touchdown passes to Devin Fuller, and UCLA got its season back on track with a 40-24 victory over No. 20 California on Thursday night.

Rosen passed for 399 yards in another splendid game for the standout freshman, and Thomas Duarte had career highs of 10 catches for 141 yards for the Bruins (5-2, 2-2 Pac-12). UCLA rebounded from consecutive losses and a drop from the national rankings with a 573-yard offensive performance.

More from FoxSports

Soso Jamabo rushed for a score after star UCLA tailback Paul Perkins left with an injury, and the Bruins' injury-plagued defense limited Jared Goff and Cal's potent offense to 170 yards in the first half.

Goff passed for 295 yards in a second straight disappointing game for the Bears (5-2, 2-2). They have lost two straight.

Kenny Lawler, Darius Powe and Khalfani Muhammad caught TD passes for Cal, which entered the Rose Bowl with its highest ranking in six years and a chance to clinch to clinch bowl eligibility for the first time since 2011. Instead, the Bears still have just one win in Pasadena since 1999.

Debuting their black-and-shiny-gold "City" uniforms, UCLA appeared revitalized after losses to Arizona State and Stanford. The defense sacked Goff five times, and Ka'imi Fairbairn made four field goals, including a school-record 60-yarder at the halftime gun.

Rosen was smooth and confident in another big Pac-12 game, going 34 for 47 without a turnover. Early in the fourth quarter, he broke the UCLA single-game completions record set by Richard Brehaut in 2010 and matched by Brett Hundley last year.

But even in victory, UCLA added two more significant injuries to its alarming season total. Perkins, last season's Pac-12 rushing champion, ran for 73 yards before limping off in the second quarter. Linebacker Isaako Savaiinaea, the Bruins' leading tackler, then left on a cart in the second half.

UCLA stumbled back to the Rose Bowl with consecutive losses in conference play for the third straight season, including a 56-35 thrashing at Stanford last Thursday that dropped the Bruins out of the Top 25. Coach Jim Mora's teams have always bounced back from those skids, and the Bruins still haven't lost three straight regular-season games in Mora's tenure.

Despite the UC rivalry, the Rose Bowl was roughly half-full before kickoff as fans struggled to get through weekday Los Angeles traffic to the relatively inaccessible stadium.

The Bruins took their first lead in three weeks when Duarte caught a 7-yard TD pass in the first quarter. Fuller capped a 90-yard drive early in the second with a 19-yard scoring grab, and UCLA moved the ball deliberately throughout the half despite settling for four field goals.

Cal finally reached the end zone on Lawler's acrobatic grab 51 seconds before halftime, but Rosen moved the Bruins into position for that 60-yard kick by Fairbairn, who was mobbed by teammates when he broke Chris Sailer's UCLA record of 56 yards, set in 1997.

UCLA kept rolling after the break, with Rosen hitting Duarte from 21 yards out for a 33-10 lead.