STANFORD, Calif. (AP) - Jordan Williamson kicked a career-long 46-yard field goal and the go-ahead score from 20 yards, and No. 21 Stanford survived a 20-17 win over San Jose State on Friday night in its first game since Andrew Luck left.

Former backup Josh Nunes threw for 125 yards and a touchdown in his first start in place of Luck, the No. 1 overall draft pick. But the redshirt junior struggled to move the offense when it counted and it almost cost the Cardinal (1-0) dearly.

The David Fales-Blake Jurich quarterback combo gave Stanford fits until De'Leon Eskridge fumbled in Spartans (0-1) territory late in the third quarter. That set up Williamson's tiebreaking kick, giving the redshirt sophomore who missed three field goals in a 41-38 loss to Oklahoma State in the Fiesta Bowl a small stroke of redemption.

Nunes finished 16 for 26 with no interceptions. Fales threw for 216 yards with one touchdown and an interception that landed in the hands of Ed Reynolds to seal Stanford's win in the final minutes. Jurich ran for 32 yards and a score.

The fight Stanford showed so many times behind Luck disappeared.

With the two-time Heisman Trophy winner now with the Indianapolis Colts, the Cardinal converted only 2 of 2 third downs (although it was 2 for 3 on fourth downs) and allowed the Spartans to move methodically at times down the field. San Jose State outgained Stanford 288 to 280 total yards.

Stanford beat San Jose State 57-3 last year and has won five straight meetings.

Stepfan Taylor, who finished with 116 yards rushing, ran for 38 yards almost untouched until a defender tackled him on the game's first drive. Remound Wright converted a fourth-and-1 from the 10-yard line, and Taylor dived over the pile for a 1-yard TD on fourth down to give Stanford a 7-0 lead.

The Cardinal followed the 13-play, 81-yard drive with a quick three-and-out by the defense. Nunes quickly led Stanford down field and tossed a perfect ball in the corner on a stop-and-go route by Drew Terrell for an 11-yard score and his first career touchdown pass.

The first-game hiccups eventually surfaced, bubbling later than expected until they almost completely popped Stanford's season.

San Jose State drove deep into Stanford territory in the second quarter until Jurich, the backup quarterback, recovered his own fumble for a 2-yard loss on third down. Austin Lopez kicked a 38-yard field goal to slice Stanford's lead to 13.

Game-clock management became an issue on Stanford's final drive of the first half, tossing a short pass over the middle to tight end Zach Ertz, then throwing incomplete and running on third down to settle for a field goal. Williamson made his career-high 46-yarder as time expired to extend Stanford's lead to 17-3.

All the same problems that plagued the Cardinal defense in losses last year to Oregon and Oklahoma State - no cornerback coverage, poor open-field tackling and quarterback pressure when it counts - looked even worse with two new starting safeties.

Jurich ran for a short touchdown on San Jose State's first possession of the third quarter and Fales floated a 21-yard touchdown pass to Noel Grigsby to tie the score at 17-all late in the third quarter

Fales, who transferred from Monterey Peninsula Community College in the spring, redshirted at Nevada in 2009. Between him and Jurich keeping the Cardinal guessing, San Jose State was outplaying Stanford and in position for the season's first shocking upset.

One mistake ended all that.

Reynolds stripped Eskridge on a pitch play, and Usua Amanam recovered the fumble at San Jose State's 38-yard line. Stanford's offense stalled again, and Williamson made his second field goal.

San Jose State stuffed Taylor on fourth-and-1 with fewer than 7 minutes to play, sending third-year coach Mike MacIntyre jumping and high-fiving all over the sideline and on the field. The Spartans took over at their own 15-yard line, but Chase Thomas tackled Fales as he threw on third-and-6 to force an incompletion.

Fales and the offense failed to even get a first down on the next two possessions and Reynolds stepped in front of his final pass to close out San Jose State's rally.

San Jose State, which went 5-7- last year after posting a 1-12 record in 2010, last win over a ranked team was 27-24 over No. 9 TCU at Spartan Stadium on Nov. 4, 2000. The Spartans are winless against 20 ranked teams since.

___

Follow Antonio Gonzalez at: www.twitter.com/agonzalezAP