CORVALLIS, Ore. -- Stanford held up its end of the bargain. Barely.
Hours after Oregon remained undefeated, the eighth-ranked Cardinal escaped with a 20-12 victory over Oregon State on Saturday night to set up a high-stakes showdown with the Ducks.
Stanford led by 11 points late in the fourth quarter but struggled to put the game away. Oregon State kicked a field goal, forced the Cardinal to punt, then zoomed into scoring range with just over one minute remaining.
But Stanford's defense, dominant all game, held on four downs at the 7-yard line. Safety Ed Reynolds batted the final pass away from receiver Kevin Cummings in the end zone to preserve the victory.
Stanford (7-1, 5-1 Pac-12) controls its own destiny in the Rose Bowl race heading into the Nov. 7 duel with the Ducks.
"It's a big win -- a road win against a ranked team in conference,'' Cardinal coach David Shaw said, referring to OSU's No. 25 ranking the Bowl Championship Series standings.
"Our defense played extremely well. We had a great gameplan and we executed very well.''
-- Stanford held OSU to 32 points below its season average.
-- The Beavers were 6 of 17 on third down, 1 of 5 on fourth down and scored touchdowns on just 20 percent of their trips into the red zone.
-- Quarterback Sean Mannion had been sacked nine times in OSU's first seven games. Stanford got him eight times.
-- Receiver Brandin Cooks had been averaging 168 yards per game. Stanford held him to 80.
"You have to be spot-on against them, and that's why we had more negative plays than we've had all year and had a hard time sometimes with protection,'' Beavers coach Mike Riley said.
Stanford's game plan was straightforward: Stuff the OSU running game and keep the receivers from making big plays.
In other words: Force the Beavers to move the ball the length of the field, a few yards at a time.
"The combination of the two made tonight made tonight a great defensive effort," Reynolds said.
The offense? Not so much.
Stanford ran the ball effectively -- Tyler Gaffney had 145 yards and three touchdowns -- but the passing game sputtered.
Quarterback Kevin Hogan was under pressure and out of rhythm, and big-play receiver Ty Montgomery had just three catches.
"We missed too many plays in the passing game,'' Shaw said.
Oregon State was the first team to score, on a 50-yard field goal by Trevor Romaine early in the second quarter.
The Cardinal finally found its rhythm before halftime. Hogan found Montgomery down the left sideline for 37 yards — Stanford's longest play of the half, by far. Two plays later, Hogan darted 23 yards to the 4-yard line.
Gaffney took it from there. He rammed into the middle of the line, kept his balance and spun to the left for a touchdown with seven seconds remaining.
Stanford had snatched the momentum as the teams broke for halftime. On the first play of the third quarter, the Cardinal took control.
OSU's Victor Bolden fielded the opening kickoff and headed across the field in right-to-left fashion. He quickly encountered the Stanford coverage team, which included cornerback Wayne Lyons.
As Bolden rushed past, Lyons stuck out his left arm and knocked the ball loose.
Stanford's Joe Hemschoot recovered at the 12, and Gaffney rumbled into the end zone two plays later for a 13-3 lead. (Kicker Conrad Ukropina missed the extra point.)
The Beavers responded late in the third quarter. Mannion had time to throw and picked Stanford apart with an array of passes, including a well-designed screen pass on third down. The play set up a short touchdown pass to Cooks, but the Beavers missed the extra point and Stanford took a 13-9 lead into the fourth quarter.
With 12 minutes left, Gaffney scored his third touchdown — a 32-yard charge over left tackle that gave Stanford was seemed a comfortable lead.
But with 4:13 remaining, Gaffney made his only mistake: a fumble at the 20. The Beavers kicked a field goal to pull within eight and set up the dramatic final sequence.
Oregon (8-0, 5-0 Pac-12) at Stanford (7-1, 5-1), 6 p.m. ESPN
Bears can't keep up with Washington's prolific attack
Fales rallies SJSU past Wyoming 51-44.