TEMPE, Ariz. (AP) Arizona State's defense limited the damage of a late shanked punt, holding Washington State to a field goal and a three-point lead.

That set the stage for Jayden Daniels.

The unflappable freshman quarterback has thrived in late moments like these through his first season and added another highlight to his resume, capping a calm-and-collected drive by spinning off a defender into the end zone for the winning touchdown.

Daniels scored on a 17-yard scramble with 34 seconds left and threw three touchdown passes to ailing Brandon Aiyuk, leading No. 18 Arizona State to a 38-34 comeback victory on Saturday.

''He's just phenomenal,'' said Arizona State's Eno Benjamin, who had 137 yards and a touchdown rushing. ''The way he goes through practice, you wouldn't think he's a freshman.''

Arizona State (5-1, 2-1 Pac-12) trailed by three after Blake Mazza made a 31-yard field goal with 2 1/2 minutes left. Taking over at their own 25-yard line, the Sun Devils moved quickly down the field behind Daniels' pinpoint passing.

The freshman who led similar drives in wins against Michigan State and Cal capped it with his scramble, helicoptering off a defender into the end zone.

Daniels threw for 363 yards on 26-of-36 passing. Aiyuk had seven catches for 196 yards despite an illness that kept him out for portions of the game.

''That's just the heart of these guys,'' Arizona State coach Herm Edwards said. ''They're very resilient.''

Anthony Gordon threw for 466 yards and three touchdowns, but Washington State (3-3, 0-3) was again let down by its defense.

The Cougars allowed 498 yards and folded when they needed to stiffen the most, allowing Daniels to hit 6 of 8 passes for 52 yards on the winning drive.

''I thought it was a team we let slip through our fingers too many times,'' Washington State coach Mike Leach said. ''We need to trust each other better.''

The Cougars lead the nation in passing yards per game, are fourth in total offense and eighth in scoring.

Washington State was good against Arizona State from the start.

Gordon took advantage of blown coverages by Arizona State to hit Travell Harris on a 35-yard touchdown and Dezmon Patmon on a 2-yard score to put the Cougars up 17-7.

Where Washington State has struggled is on defense, so much that defensive coordinator Tracy Claeys abruptly resigned this week.

Washington State's defense was solid early under interim coordinator Roc Bellantoni, sacking Daniels three times in the first nine plays while holding Arizona State to 23 yards in the first quarter.

The Sun Devils came alive behind the Daniels-Aiyuk connection. The pair hooked up on a 40-yard touchdown early in the second quarter, then Aiyuk broke a tackle to turn a short completion into an 86-yard score .

Cristian Zendejas' 31-yard field goal on the final play of the first half tied the game at 17-all.

Arizona State took a 24-17 lead to open the second half when Eno Benjamin turned a fourth-and-1 into a 32-yard touchdown run.

Washington State responded with drives of 91 and 92 yards, scoring on a 2-yard pass from Gordon to Easop Winston Jr. and Max Borghi's 2-yard run.

Daniels and Aiyuk connected for a third score, a 33-yarder to tie it at 31-all.

Washington State took a late lead, but left too much time on the clock for Daniels and the Sun Devils.

''We let a couple of things slip and that's what cost us the game,'' Washington State defensive lineman Dallas Hobbs said.

THE TAKEAWAY

Another huge offensive game (532 total yards) by Washington State, another defensive letdown leaves the Cougars winless in Pac-12 play.

The calm, cool play of Daniels has the Sun Devils rising, likely up a few spots in next week's AP Top 25.

BENJAMIN BUSTING

Benjamin seems to be getting better as the season progresses.

Coming off a three-touchdown game against Colorado, the junior running back averaged 7.2 yards per carry and showed off the burst that helped him finish fifth in the FBS in rushing yards last season. Benjamin has 529 yards and seven touchdowns this season.

SELF-ICING THE KICKER

Mazza got a second try on his late go-ahead kick - thanks to icing by his own coach.

Not liking what he saw, Leach called timeout just before Mazza let his first try fly. He missed the kick but made the second, so the unconventional strategy paid off.

UP NEXT

Washington State hosts Colorado next Saturday.

Arizona State plays at Utah next Saturday.

---

More AP college football: https://apnews.com/Collegefootball and https://twitter.com/AP-Top25

Copyright 2019 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.