STANFORD, Calif. -- Stanford won its season opener on Friday, but it discovered life might be a lot more difficult without quarterback Andrew Luck running the show.
Luck's replacement, Josh Nunes, had decent numbers in his first collegiate start, but No. 21 Stanford had a much tougher time than expected and needed a fourth-quarter field goal to manage a 20-17 victory over San Jose State at Stanford Stadium.
Nunes, a fourth-year junior who had not played in a game since 2010, was 16-for-26 for 125 yards, a touchdown and no interceptions, and Cardinal tailback Stepfan Taylor rushed for 116 yards.
"Josh played great," Stanford coach David Shaw said. "He got us into the right plays. He didn't play like a first-year starter. He played like the senior that he is."
However, the Cardinal defense had trouble controlling Spartans quarterback David Fales, who was 24-for-35 for 216 yards and touchdown in his first Division I start. Four of his throws were dropped, and his lone interception came in a desperation situation at the end.
"I thought David played really well," San Jose State coach Mike MacIntryre said. "We dropped a couple balls we usually catch, but that's the way it goes."
Fales, a junior college transfer, rallied the Spartans for two third-quarter touchdowns to tie the game entering the fourth quarter, but a Spartans turnover stopped the momentum and helped the Cardinal survive.
Stanford jumped out to an early 14-0 lead and appeared headed for a victory that would be as easy as last year's 57-3 rout of the Spartans. But the Cardinal offense was unable to continue its dominance as San Jose State worked its way back into the game.
"We played hard; we didn't play smart," Shaw said. "We missed some critical blocks, which is inexcusable."
The Spartans closed a 17-3 halftime deficit to 17-10 by going 78 yards on their first possession of the second half. Fales completed passes of 20, 21 and 20 yards on the drive, which ended with backup quarterback Blake Jurich scoring from three yards out.
San Jose State then tied it on an 82-yard drive that ended on Fales' 21-yard scoring pass to Noel Grigsby with 2:17 left in the third quarter.
San Jose State regained possession after a Stanford punt, but a fumble by De'Leon Eskridge was recovered at the Spartans' 38-yard line by Cardinal defensive back Usua Amanam, who also had two sacks in the game.
Stanford turned that into a 20-yard Jordan Williamson field goal to take a 20-17 lead early in the fourth quarter. But the Cardinal was unable to score a second-half touchdown.
"Overall, we were close to doing a lot of good things," Nunes said, "but close sometimes doesn't get it done."
Taylor was stopped short of a first down on 4th-and-1 at the Spartans' 15 on the next Cardinal possession, but San Jose State could not mount much offense in the fourth quarter. Fales' fourth-down pass from the San Jose State 30-yard line with a little more than a minute left was intercepted by Ed Reynolds.
MacIntyre avoided claiming a moral victory, but he noted the improvement from the 1-12 season in his first year as the Spartans' coach in 2010.
"Since we got our butts kicked here last year, we could have won every game we've been in," he said. "And that sure wasn't the way my first year. So we are definitely making strides."
The first half ended with Williamson kicking a 46-yard field goal on the final play of the second quarter to give the Cardinal 17-3 lead.
Stanford demonstrated its 2012 offensive philosophy on its first possession, when it simply bulldozed the Spartans' defense.
The Cardinal used 13 plays, 10 of which were runs, to cover 81 yards, eat up 6:27 and score its first touchdown.
The key play was a 38-yard Taylor run out a three-tight end formation that got the Cardinal to the Spartans' 19-yard line.
Stanford made it 14-0 at 4:23 of the first quarter on a 50-yard scoring drive. Nunes finished it with a perfectly placed 11-yard scoring pass to Jamal-Rashad Patterson.
Fales' passing enabled the Spartans to get to the Stanford 29-yard line early in the second quarter, and Austin Lopez kicked a 38-yard field goal to make it 14-3.
NOTES: Stanford inside linebacker Shayne Skov was suspended for Friday's game because he was arrested for DUI last January. He is expected to play in next Saturday's game against Duke, which would be his first game since tearing his anterior cruciate ligament in the third game last season. ... The San Jose State-Stanford game is known as the Bill Walsh Legacy Game. Walsh was a head coach at Stanford and a graduate of San Jose State. ... This was the first Friday night game ever played at Stanford Stadium. ... Stanford's top two fullbacks, Ryan Hewitt (ankle) and Geoff Meinken (knee), did not play because of injuries.