Owen Marecic scored his second touchdown of the game with 5:14 remaining to play to give seventh-ranked Stanford a 17-13 come-from-behind Pac-10 victory over host Arizona State on Saturday.
Andrew Luck threw for 292 yards on 33-of-41 passing as the Cardinal (6-1, 9-1) survived the struggle against the determined Sun Devils (2-5, 4-6), who lost their fourth game by four points or less.
Nate Whitaker added a 44-yard field goal as Stanford won at Arizona State for the first time since 1999 and just the fourth time in 14 trips to Tempe.
The Cardinal, off to their best 10-game start since 1951, travels to California for the Big Game next Saturday at 12:30 p.m.
The Cardinal made up for their offensive struggles with hard-nosed defense, holding the Sun Devils to 268 total yards.
"When you have the best quarterback in the nation, a Heisman candidate on the other side of the ball, you just have do your job and keep them out of the end zone," Stanford cornerback Richard Sherman said. "No matter how long it takes, he's going to get it done."
Cardinal receiver Doug Baldwin set a single-game career-high with 122 receiving yards and 10 catches. It was the second 100-yard game of the season and in his career.
It was a strange day in the Pac-10 as the visitors won all four games, including Washington State's first conference win, 31-14, at Oregon State. The Cougars entered the day with the fewest points scored and the most allowed. They scored the most points of the afternoon.
Oregon entered the game as the conference's highest scoring team, and managed the fewest of any winning team. Three of the four conference games were decided by four points or less.
Stanford clinched no worst than a second-place finish thanks to both the Beavers and Arizona losing at home.
Stanford struggled to run the ball effectively against the Sun Devils, managing 128 yards on 42 carries with Anthony Wilkerson (a team-leading 65 yards) and Stepfan Taylor (39) accounting for 81 percent of the production.
"I think this is the kind of game that brings your guys together," Stanford coach Jim Harbaugh said. "You rely on each other, you trust in each other and every play is critical. They feel good about each other because they know their teammates played like champions. Champions win those type of games."
Luck had one pass picked off in the fourth quarter to end one scoring threat, but he drove the Cardinal 85 yards for the winning score.
The defenses took over after each team scored in the first quarter.
Arizona State stopped Stanford on a fourth-and-1 near midfield and drove to the Cardinal 3-yard line. That's where cornerback Michael Thomas hit ASU quarterback Steven Threet as he dove for the goal line and Stanford recovered the fumble in the end zone.
The Sun Devils made the next defensive stand when Oliver Aaron sacked and forced a fumble from Luck. Junior Onyeali recovered at Arizona State's 27.
The nation's fifth-highest scoring team, 30 points in a school-record nine straight games entering, the Cardinal found themselves tied at halftime for just the second time this season.