BERKELEY, Calif. (AP) -- The scoreboard never reflected Oregon State's domination, so coach Mike Riley couldn't enjoy an impressive upset until California made its final mistakes.
Yvenson Bernard rushed for a career-high 185 yards and the go-ahead touchdown with 6:41 to play as Oregon State snapped No. 18 Cal's 10-game home winning streak in a 23-20 victory on Saturday.
Matt Moore passed for 196 yards despite three interceptions and Oregon State's defense forced five turnovers in a miserable performance by the Golden Bears (5-2, 2-2 Pac-10), who lost their second straight after the school's best start since 1996.
The Beavers (4-2, 2-1) throttled Cal's vaunted rushing attack and moved the ball easily themselves for most of the day -- yet turnovers, penalties and mistakes kept it close.
"It was scary," said Riley, whose Beavers won at Cal for the second time in three seasons. "They were always in striking distance. ... [But] our team never thought we couldn't stop them and that we couldn't move the ball."
With good reason. Bernard rushed 40 times and scored two touchdowns in the second half for the Beavers, whose 35-21 victory at Memorial Stadium in 2003 was the most recent win by a visitor. That Saturday, Oregon State harassed Aaron Rodgers into one of his worst games at Cal -- and it did the same to Joe Ayoob this time.
The Beavers, who celebrated with their band and a large cheering contingent after the game, also snapped an eight-game losing streak against ranked teams. They outlasted the mistake-prone Bears, stopping three potential game-winning drives by Cal's once-potent offense.
"It's been five years since we beat a ranked team," Oregon State linebacker Andy Darkins said. "We're going to roll with this. ... We felt the whole week that if we stop Cal's run game and make Ayoob throw it, we could win."
Cal has been ranked every week since the 2004 preseason poll, but the Bears followed up their 47-40 loss at UCLA last week with one of their worst efforts in coach Jeff Tedford's four seasons.
After Bernard's decisive score, Cal had three chances to make a winning drive -- but Ayoob sprayed incompletions all over the field, finishing his 13-for-39 performance for 219 yards and two interceptions.
"They blitzed a lot and played the run extremely well," Ayoob said. "They almost made us a one-dimensional team. They forced me to make throws, and I didn't make them. We were lucky to even be in the game with five turnovers."
Meanwhile, Cal's vaunted ground game vanished behind an injury-plagued offensive line, ending its streak of 18 games with a 100-yard rusher.
Marshawn Lynch rushed for 58 yards but was benched by Tedford for the second half after two fumbles -- and Justin Forsett, the nation's ninth-leading rusher, had just 17 yards on nine carries.
Lynch threw an early 21-yard touchdown pass to Ayoob, who also threw a touchdown pass and rushed for a score. But Ayoob struggled to make the simplest completions against one of the nation's worst pass defenses, going 4-for-20 in the fourth quarter.
"I'm sure our leadership will surface," said Tedford, who put most of the blame on his offense. "We need to grow up and understand that attention to detail is what makes us win. ... We need to be sharper at quarterback, there's no doubt about that. [Ayoob] is a confident guy, and hopefully he bounces back."
Cal lost star defensive lineman Brandon Mebane to a sprained right ankle in the first half, abetting Bernard's impressive game. Star Cal tackle Ryan O'Callaghan became the third offensive lineman to get a concussion this season, sitting out most of the game.
Oregon State got inside the Cal 10 four times in the first half but settled for Alexis Serna's three field goals. Bernard rushed for a 31-yard TD in the third quarter to put Oregon State up 16-14, and another strong drive fizzled when Bernard fumbled the ball into the end zone for a touchback.
Oregon State also returned a fumble for a touchdown on a play negated by a face-mask penalty, and Cal linebacker Mickey Pimentel intercepted two of Moore's passes.
But the Bears made bigger blunders. Lynch fumbled on the Cal 8 midway through the second quarter, though Pimentel grabbed his second interception and returned it 77 yards, leading to DeSean Jackson's TD catch on a 6-yard fade pattern.
Lynch fumbled again moments before halftime, and he didn't play again.
"No, no problem at all," Lynch said of his benching. "Put the ball on the ground two times, I guess that's what happens."