PASADENA (AP) — Soso Jamabo rushed for the go-ahead touchdown with 8:28 to play, and No. 24 UCLA blew an 18-point lead before escaping the Rose Bowl with a 35-31 victory over Colorado on Saturday.

Josh Rosen passed for 262 yards and a touchdown for the Bruins (6-2, 3-2 Pac-12), who avoided an embarrassing loss despite giving up 18 consecutive points in the second half and yielding 554 total yards to the Buffaloes (4-5, 1-5), who haven’t beaten a ranked team on the road since 2002.

READ MORE: Scorching Hot Temperatures Hit The Southland

Patrick Carr rushed for 110 yards, and his TD run put Colorado ahead with 12:04 to play. The Bruins answered with Jamabo’s score before stopping the Buffaloes twice in UCLA territory.

Takkarist McKinley’s pressure forced a poor throw by Sefo Liufau on fourth down with 3:34 to play. Nate Meadors intercepted a pass by Liufau near midfield with 51 seconds left.

Liufau went 37 of 57 for 312 yards while Colorado ran a school-record 114 plays, outgained UCLA by 144 yards and had the ball for more than 41 minutes.

The Buffs still lost their 20th straight game against ranked teams, including 25 straight on the road. After beating Oregon State last week, they fell painfully short of the first back-to-back Pac-12 victories in school history.

Samson Kafovalu returned a fumble 33 yards for a touchdown early in the fourth quarter for Colorado. Donovan Lee also rushed for a score.

Paul Perkins had an 82-yard touchdown run among his 118 yards and two scores for UCLA, and Ishmael Adams returned an interception 96 yards for a second-quarter touchdown. Nate Starks rushed for a score for UCLA, which still could win the Pac-12 South by winning its final four regular-season games.

READ MORE: Milestone: California Reopens, Lifts Majority Of Its Mask Restrictions, Ends Social Distancing Requirements

Nelson Spruce became the Pac-12’s career receptions leader in the second quarter for the Buffaloes, finishing with 11 catches for 90 yards. Spruce has been a stalwart on four mediocre Colorado teams, and he passed the Pac-12 record of 259 catches set by Arizona’s Mike Thomas in 2008.

Colorado headed into an 88-degree Halloween game at the Rose Bowl hoping to build on its first Pac-12 victory since 2013. Instead, the Buffaloes wasted an enormous advantage in possession over the Bruins, running 40 plays to UCLA’s four in the second quarter alone.

Colorado’s frustration began early and extended throughout the first half. The Buffaloes got no points from two 16-play drives, and they managed only field goals from an 11-play drive and a 13-play drive after that.

After a short missed field goal in the first quarter, the Buffs got back inside the UCLA 5 before Liufau was picked off by Adams, who returned it untouched down the UCLA sideline. Adams missed UCLA’s first three games after a preseason arrest.

Colorado made it interesting in the fourth quarter when Rosen fumbled while getting sacked. The ball went straight to Kafovalu, and the defensive tackle returned it with 14:37 to play.

The Buffaloes then went 68 yards in two plays to take a 31-28 lead on Carr’s TD run and a 2-point conversion with 12:04 left.

The Rose Bowl was frightened, but Rosen confidently led a 69-yard drive culminating in Jamabo’s scoring run.

MORE NEWS: Asian American Woman Attacked In Alleged Hate Crime In Culver City

(© Copyright 2015 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)