The winning points came on the foot of kicker Jordan Williamson, who kicked a 37-yard field goal in the first overtime session.

It was Stanford's first victory over a No. 1 team since a 1990 win at Notre Dame.

The signature win of second-year coach David Shaw's career means Stanford will win the Pac-12 North title if it defeats UCLA on Saturday. (If Stanford loses, it would win the North only if Oregon loses at Oregon State.)

The defensive struggle featured numerous mistakes by both teams and a stunning number of punts.

Stanford tied the game with 1:35 remaining on a 10-yard pass from quarterback Kevin Hogan to tight end Zach Ertz. Initially ruled an incompletion, the call was overturned after a lengthy review. The touchdown capped a 78-yard drive that included a fourth-down conversion at Oregon's 12.

The Ducks got the ball first in overtime but gained just one year. Kicker Alejandro Maldonado missed a 41-yard field goal.

Stanford nearly lost the ball in overtime when Hogan fumbled, but the Cardinal recovered to set up Williamson's game winner.

The game began in unexpected fashion, with an exchange of punts.

The Ducks appeared ready to strike first after quarterback Marcus Mariota darted 77 yards down the right sideline. He would have scored if De'Anthony Thomas had executed a simple downfield block. Instead, Mariota was dragged down at the Cardinal 15. The gaffe ended up costing the Ducks a touchdown when Stanford held on fourth down.

The offense took it from there. Over the next seven minutes, quarterback Kevin Hogan directed a masterful 93-yard drive that included several third-down conversions and a bevy of high-percentage passes to tight end Zach Ertz and fullback Ryan Hewitt.

Hogan capped the drive with a nifty touchdown run in which he dodged two defenders and lunged into the end zone.

The half ended in a 7-7 tie, a stunning development given the Ducks were averaging 34.8 points in the first half this season.

Oregon had first crack in the second half but was forced the punt. The Cardinal did nothing with its offense on the field, but punter Daniel Zychlinski pinned Oregon back at the 5.

It made little difference. Using a mix of runs and passes, the Ducks went 95 yard for the go-ahead touchdown, a six-yard run by Thomas.

Oregon had a chance to build on its lead when Stanford's Kelsey Young fumbled on the ensuing possession. But a holding penalty derailed the drive and a missed field goal left the Ducks with nothing to show for the turnover.

The Cardinal lost the ball again late in the third quarter when tailback Stepfan Taylor fumbled after an 18-yard run. The Ducks recovered at their 20 but were again held without a first down and forced to punt.

Stanford kept the pressure on with its best drive of the second half. But backup tailback Remound Wright was stopped for no gain on third-and-three at Oregon's 26.

Down a touchdown with eight minutes left, Stanford elected to try a 43-yard field goal. Kicker Jordan Williamson, who was 3 of 7 beyond 40 yards, missed wide left.