ALBUQUERQUE - Days before he orchestrated one of the most unlikely comebacks in Arizona Wildcats football history, Matt Scott submitted his final college assignment.

The pages-long term paper for an independent study class, Scott's last before graduation, was on a topic the quarterback picked himself: The importance of failure.

Scott practically majored in adversity during his five-year UA career, which ended with Saturday's improbable 49-48 victory over Nevada in the New Mexico Bowl. For the first 3 1/2 quarters Saturday, he seemed destined for another uneven performance and, ultimately, a postseason loss.

Then Scott caught fire, saved a season and cemented his legacy.

The dual-threat quarterback threw three fourth-quarter touchdown passes, two coming in the final 46 seconds, as the UA pulled off a come-from-behind victory for the ages. His 2-yard strike to Tyler Slavin with 19 seconds remaining tied the game; John Bonano's ensuing point-after gave the Wildcats (8-5) their first bowl victory since 2008.

Forget failure. Scott is going out a winner.

"It changes a lot," Scott said Saturday, his eyes watering and voice breaking. "I've been through a lot here at the university, and it's been a tough time for me. My career could have gone a couple of different ways, but I decided to stay and compete and try to get better. I didn't quit."

Saturday, neither did the Wildcats.

Nevada ran roughshod on Arizona for the first 58 minutes 12 seconds, gaining 659 yards - 403 of them on the ground. Allen Hardison hit a 25-yard field goal with 1 minute 48 seconds remaining to give the Wolf Pack a 48-35 lead.

With no timeouts left and trailing by two scores, Arizona attempted the improbable. Scott completed 6 of 7 passes for 38 yards on the drive; Nevada was called for two pass interference penalties, including one - on Duke Williams - that moved the ball to Arizona's 2. One play later, Scott hit Austin Hill for a touchdown, and Nevada led by six with 46 seconds left.

Then came the craziness.

John Bonano belted an onside kick off of Williams' chest, and Arizona's Marquis Flowers recovered at the UA's 49 with 40 seconds left. Scott found Garic Wharton for 28 yards and Hill for 21 yards, moving the Wildcats to Nevada's 2 with less than 30 seconds remaining. When Slavin got open on a slant route, Scott placed the ball perfectly in his hands. One PAT later, the Wildcats led for the first time all game. Nineteen seconds remained.

First-year coach Rich Rodriguez called the ending "improbable," if only because it required all phases - offense, defense and special teams - to do something uncommonly good. If Arizona didn't hold Nevada to a field goal, he reasoned, the comeback would have never happened.

"Certainly, I've had some games come down to that end," he said. "But to have everything - the defense making the stop, the field goal, Matt leading the quick drive down there, getting the onside kick which is very rare to have, and then Matt leading us down again - it just doesn't happen very often."

Flowers said, "It was unbelievable."

Scott completed 28 of 47 passes for 387 yards and three touchdowns in his final college game and was intercepted twice. He was named the game's offensive MVP, one that should have come with a lifetime achievement award. Scott enrolled at the UA in 2008 with hopes of following Willie Tuitama. Over the next four years, Scott won and then lost the starting job, watched while quarterback Nick Foles became a star, suffered two debilitating injuries, took a redshirt year and watched as coach Mike Stoops was fired.

Rodriguez's hiring 13 months ago changed Scott's career, and put all of Arizona's offensive records in jeopardy.

The UA finished Saturday's game with 578 yards. Ka'Deem Carey rushed for 172 yards and three touchdowns, giving him the UA's single-season record with 23 rushing scores. Carey finished the year with a program-record and nation-leading 1,929 yards, a 148.38 yards-per-game clip that also stands as the most in the country.

Carey must wait for a handful of other to bowls to be completed before he can be named rushing champ. He has 158 more yards than Northern Illinois' Jordan Lynch and 199 more than Wisconsin's Montee Ball.

Nevada's Stefphon Jefferson outran Carey on Saturday, gaining 180 yards on 34 carries and scoring twice, but trails the UA star in total yards (1,883) and yards per game (144.8). Wolf Pack quarterback Cody Fajardo threw for 256 yards and three touchdowns and rushed 22 times for 140 yards and a score.

But Scott's best was better. And Saturday, his timing was incredible.

"Those last two drives, you had to be almost flawless with the amount of time we had left," Rodriguez said.

"Matt Scott was flawless. That was why we won the game."