TUCSON -- Drenched in sweat as the clock ticked past midnight into Saturday morning, Arizona State coach Todd Graham tapped into his reserve tank for one last meet-and-greet with fans.

Eyes wide-open, cheeks flushed red and smiling from ear to ear, the first-year coach clutched the oldest trophy in college football in his arms like a long-lost friend as he took a victory lap around Arizona Stadium, allowing supporters to touch the cup as he moved along.

All Graham could say when he later tried to explain himself was, "I was just being me."

It wasn't a "me" the coach had shown much before though, as he displayed even more fervor than his typical enthusiastic self.

This win, at the culmination of his first season, was special for his fledgling program and he knew it.

Behind the type of inspired performance Graham had promised when he first took over nearly a year ago, ASU overcame a 10-point fourth quarter deficit to defeat arch-rival Arizona, 41-34, and take back the Territorial Cup to Tempe.

"I want everyone to know I appreciate them and I am proud to be their coach," Graham said. "This was the game for us. It was big not only winning, but how we won. I thought tonight was an unbelievable example of our character. It's huge for us."

Entering the fourth quarter, the Sun Devils (7-5, 5-4 Pac-12) trailed 27-17, but ended the game on a 24-7 run aided by three major miscues by the No. 24 Wildcats (7-5, 4-5 Pac-12) to pull away.

"I'm so proud of my team," said ASU senior linebacker Brandon Magee, who recorded a career-high 17 tackles in the game. "This meant a whole lot. We lost a few games in a row and people were starting to lose faith. Now they aren't. It happens just like that."

The win came after uncertain, even desperate, times earlier in the evening. At multiple junctures during the game Friday, the Sun Devils' chances looked bleak at best. None more so than when UA, with a touchdown lead, drove the ball down to the ASU 18 yard line for a first down with less than 10 minutes remaining in the fourth quarter.

But on the very next play, ASU senior safety Keelan Johnson stood up UA senior quarterback Matt Scott on a keeper and stripped the ball out, eventually resulting in a recovered fumble by the Sun Devils near midfield.

"They just didn't play smart football there," Johnson said. "But it was a lot of excitement. I was proud of how these guys fought back. It was a great feeling."

The turnover flipped a potential Wildcat knockout punch into new life for ASU, a life the Sun Devils didn't waste.

Six plays later ASU marched the ball into the endzone to tie the game on a junior running back Marion Grice four yard score.

"I thought that was one of the biggest plays of the game," Graham said of Johnson's forced fumble. "We held him up and got the ball out. That was huge."

On the ensuing UA drive, the ASU defense forced a three and out, allowing the Sun Devil special teams unit a chance to put its imprint on the game. ASU senior Kevin Ayers came around the side of the Wildcat punt formation and blocked the kick, giving his offense field position in the shadow of its opponent's own goal.

"We went after every single punt," Graham said. "Ayers blocked one against Oregon State, he has a knack for it. It was big too."

After the block all it took was one play and ASU senior running back Cameron Marshall rumbled into the endzone, handing the Sun Devils' their first lead since early in the third quarter, 34-27.

Still with the chance to potentially send the game into overtime, the Wildcats' hopes dissipated on its next possession when Scott threw his third interception of the game, caught by ASU junior defensive back Robert Nelson, who returned it all the way to the two yard line.

The Sun Devils would later punch it in on a one yard Michael Eubank rush to go ahead by two touchdowns and put the game out of reach.

"I'm overwhelmed, I dreamed to be able to play in games like this, it means a lot," Nelson said. "I never pictured myself playing on a big level like this, making plays. I'll remember this forever."

The Wildcats tacked on a touchdown later to close the gap to within seven but ASU recovered an onside kick to seal the win. The seventh victory clinched a winning season for the first time since 2007.

Aided by his 156 yards rushing and three touchdowns, Grice was named the game's Most Valuable Player for his efforts. His longest run, a rumble of 52 yards while making at least five Wildcats miss, gave the Sun Devils their first points of the game.

"He's just now getting started," Graham said. "He's going to be special."

ASU sophomore quarterback Taylor Kelly didn't light up the stat sheet, but played particularly well Friday evening. While rushing for 42 yards mostly on newly implemented triple-option plays, he completed 16-of-28 passes for 191 yards. He could've had a couple touchdown passes but ASU senior wide out Rashad Ross dropped a two balls and Kelly overthrew him once. Most importantly, he didn't turn the ball over.

"We came together when stuff hits the fan," Kelly said. "I've got unbelievable confidence in my receivers. I told them to stay focused and it's never over. We pulled together and just grinded it out."

If the Sun Devils hadn't stolen the win, UA sophomore running back Ka'Deem Carey likely would've taken home much of the Wildcats' praise. While battling through a shoulder injury for much of the night, the nation's leader rusher totaled 172 yards on the ground and a touchdown.

Like his Wildcat counterpart, ASU junior defensive tackle Will Sutton also played through pain Friday, coming out of the game three separate times for medical attention on his right foot before returning to action. When he was in the game, Sutton made the most of his snaps, disrupting the UA running game in the backfield.

His best play Friday came on Johnson's forced fumble of Scott when he pushed a Wildcat lineman out of the way of the squibbing ball so his Sun Devil teammates could secure the turnover.

"He's going to be really really sore," Graham said. "He was going to play though. That's the way our guys are. They refuse to stay down."

There we plenty of opportunities for ASU to stay down Friday, too. ASU committed three early defensive penalties then fumbled in UA territory near halftime, which resulted directly in three Wildcat points aided by a Magee roughing the passer. Then in the third quarter sandwiched between Ross' drops, the Sun Devils fumbled again, this time on a snap that hit a motioning Jamal Miles in the backfield.

But because of how the game ended, with the Sun Devils lifting up the Territorial Cup for the first time since 2010, all miscues were forgiven.

Next up on ASU's agenda is a bowl game, likely the Kraft Fight Hunger Bowl in San Francisco, but Graham, typically a forward thinker, won't be worried about that challenge just yet.

He and the rest of his team are going to celebrate their newest addition to the Sun Devil trophy case.