Stanford has not scored a touchdown in its last seven quarters of football. The Cardinal didn’t find the endzone once on Saturday against Arizona State.

And it hasn’t really mattered. The Cardinal have back-to-back wins after hanging on to beat Arizona State at home 15-14.

Stanford went nearly a full season’s worth of games without beating an FBS opponent before going on the road last week and downing Notre Dame 16-14. Kicker Joshua Karty was the hero then, connecting on three field goals — one in each of the game’s final three quarters — to give the Cardinal a much-needed win away from home.

Karty was the hero again on Saturday against the Sun Devils, hitting all five of his field goal attempts to tie a single-game program record at Stanford.

“We’ve been calling him a weapon for years,” coach David Shaw told the Pac-12 Network after the game. “He’s a weapon. What he did today is not a surprise to anybody.”

Karty connected on a pair of 36-yard kicks, a pair of 44-yard kicks, and then a 47-yarder with 6:28 to play in the game.

Following a 39-yard passing score from ASU quarterback Emory Jones to wideout Elijhah Badger early in the second quarter, Arizona State had a 14-6 lead that lasted until midway through the third. In the second half, Stanford just kept chipping away at the deficit.

Quarterback Tanner McKee completed 33 of his 57 pass attempts for 320 yards. In his first game without Michael Wilson, Stanford’s leading receiver, McKee did well to spread the football around. Brycen Tremayne had five catches for 60 yards. Elijah Higgins had six for 73. Tight end Ben Yurosek had 10 for 78. And John Humphreys had eight for 93.

On the other side, Arizona State went back to quarterback Emory Jones after his backup, Trenton Bourguet, piloted a 45-38 upset win over Washington a week ago. Jones finished 14-for-25 for 227 yards and an interception.

Badger (six catches, 118 yards) had a strong individual day as the ASU offense started red-hot. The Sun Devils gained 150 yards on just 13 plays during their second and third possessions of the game. On the eight possessions that followed, ASU totaled 211 yards on 45 plays (4.7 a play). It punted the ball on four of its five second-half possessions.

The final drive nearly saw ASU give itself a chance to win. Badger hauled in a one-handed fourth-and-19 catch that would have put Arizona State inside Stanford’s 5-yard-line with less than 10 seconds on the clock to try for a game-winning field goal.

His right foot was just out of bounds along the left sideline.

This close.

Stanford moved to 3-4 win the win, picking up its first victory in Pac-12 plays so far this year (1-4). The Cardinal play UCLA at the Rose Bowl next Saturday.

Arizona State dropped to 2-5 and 1-3 in the Pac-12. The Sun Devils will face Colorado at Folsom Field next Saturday.