Oregon couldn't recover a second onside kick and Stanford ran out the clock.
And the biggest winners of all? No. 3 Florida State. The Seminoles don't have to worry about the Ducks nudging them out of second place in the BCS standings.
The Seminoles were in danger of slipping to third in the BCS if Oregon could have registered a big road victory against a quality opponent. Now, Florida State faces a manageable remaining schedule with a good chance to win its way to the BCS championship game at the Rose Bowl.
Stanford won a three-point game in overtime at Oregon last year to deny the Ducks a chance to play for the national title. It didn't look as if there would be any drama in the return bout on the Farm. Stanford led 17-0 at halftime and added three more field goals by Josh Williamson in the second half.
Oregon looked like dead Ducks, down 26-0 early in the fourth with Stanford hammering away behind Gaffney, who set a school record with 45 carries. Even after Oregon finally broke the seal with a 23-yard touchdown pass from Mariota to Daryle Hawkins, the Cardinal went on another time-consuming drive and attempted a long field goal that would have sealed it.
Instead, the Ducks blocked it, Hardrick scooped and scored from 65 yards out with 5:08 left.
Only 5 seconds later it was even more interesting when the Ducks recovered an onside kick. Mariota threw a touchdown pass to Pharoah Brown with 2:12 remaining, but the time it took the Ducks to get in while burning a timeout was key.
O Stanford ends Oregon's BCS title hopes for a second straight season.
• The Cardinal get out to a 26-0 lead, then hold off the Ducks' fourth-quarter rally.