STANFORD, Calif. — Even without Andrew Luck, Stanford still had every answer for Matt Barkley and Southern California.
Josh Nunes threw a go-ahead 37-yard touchdown pass to Zach Ertz, Stepfan Taylor ran for 153 yards and scored two touchdowns, and No. 21 Stanford upset second-ranked USC, 21-14, Saturday night for its fourth straight win in the series.
Heisman Trophy hopeful Matt Barkley threw for 254 yards and two interceptions while completing only 20 of 41 passes. He was sacked twice on the final drive for the Trojans (2-1, 0-1 Pac-12) and threw out of bounds on a final, desperate heave on fourth and 39 from USC’s 25-yard line.
Coming out of a two-year bowl ban, USC had national title hopes this season. Now the Trojans will have to climb out of another hole to get there.
A sold-out crowd at Stanford Stadium rushed the field, tossing streamers and jumping in a wild celebration at midfield with Cardinal coach David Shaw and players caught in the middle of the mess. Stanford (3-0, 1-0) is 3-0 for the third straight season for the first time since 1970-72 and has its longest winning streak ever against USC in a rivalry that dates to 1905.
‘‘I love the energy and I love the enthusiasm,’’ Shaw said. ‘‘But we are not surprised.’’
Barkley has beaten every conference team but is 0-4 against Stanford. The only chance the senior quarterback has for revenge against the Cardinal now is a rematch in the Pac-12 title game.
Stanford’s Jordan Williamson missed field goals of 47 and 23 yards and had a 51-yarder blocked by T.J. McDonald. With a defense that flustered Barkley and a new quarterback that found his footing late, the kicker who missed three field goals in the Fiesta Bowl loss to Oklahoma State last season could smile in the pile with everybody else.
Except for the Trojans, that is.
Taylor took a short screen pass and scurried 23 yards for a tying touchdown late in the third quarter. Nunes scampered 12 yards on a third-and-10 from midfield in the fourth and then delivered the strike to Ertz, who juked a defender and dove into the end zone to give Stanford a 21-14 lead and send the home fans into a frenzy.
The last chance for USC never amounted to much.
Marqise Lee caught an 18-yard pass on fourth and 4 on the sideline that was originally ruled out of bounds. After a video replay, officials ruled Lee’s left foot landed in bounds and he controlled the ball.
Mistakes finally doomed the Trojans.
USC had a 10-yard holding penalty, then Trent Murphy sacked Barkley, followed by a 5-yard false start penalty on the Trojans and a sack by Chase Thomas before Barkley’s final heave out of bounds.
Nunes, a redshirt junior, threw for 215 yards, 2 touchdowns, and 2 interceptions on 15-for-32 passing.
USC center Khaled Holmes, who left last week’s victory over Syracuse on a cart with a right leg injury, struggled along with the rest of the offensive line to protect Barkley from Stanford’s relentless rush.
Stanford sacked Barkley four times and had him constantly losing his poise in the pocket. The Cardinal outgained the Trojans, 417-280, in total yards and held USC to only 26 yards rushing.
‘‘Against the best quarterback in the nation, these guys played great,’’ Shaw said of his players.
The Trojans seemed poised to run away from Stanford at the start.
But each time the Trojans scored, Taylor — often in Luck’s shadow the past three years — refused to let his team go without a fight and perhaps launched his own Heisman campaign in the process.
Taylor ran 59 yards for a touchdown that tied the score at 14 midway through the third quarter.
A pass interference penalty by Terrence Brown against Lee extended USC’s drive in the second quarter. Then Robert Woods caught a 24-yard pass from Barkley to set up Penn State transfer Silas Redd’s second short TD run to give the Trojans a 14-7 lead.
At one point, Barkley threw two interceptions — one to Jordan Richards and one to Brown — sandwiched between an interception thrown by Nunes that landed in the hands of Dion Bailey on three consecutive plays. Jawan Starling picked off another pass by Nunes in the final seconds of the half.