SALT LAKE CITY -- Utah's slow and steady approach did indeed win the race.
The Utes used a steady diet of short passes and runs up the middle to move the chains, run the clock and eventually upset No. 5 Stanford 27-21 on Saturday night.
The Cardinal (5-1) lost for the first time in 14 games, and Utah (4-2) beat a top-5 team for just the second time in school history.
"I feel like we just won the national championship," Utah receiver Dres Anderson said. "It feels great. Everybody's excited."
Stanford nearly rallied from a 13-point fourth-quarter deficit. But the Cardinal's final drive ended at the Utah 6-yard line when Kevin Hogan's fourth-and-2 pass sailed over Devon Cajuste's head and out of the end zone in the final minute.
"It's huge," Utah defensive end Trevor Reilly said of the final defensive stand. "We gave up a few plays there, but at the end we really came through. Our thing as a team this year is toughness, and I think it was personified on that last stand."
Reilly recovered two fumbles in the second half and each led to Andy Phillips field goals -- 23 and 48 yards. The latter gave Utah a 27-14 lead with 14:13 remaining in the game.
Stanford, which entered the game 21st in the nation defending the run at 111.8 yards per game, allowed 182 yards -- 111 by redshirt sophomore Bubba Poole.
But it was the short passing game of quarterback Travis Wilson that did the most damage. The sophomore, who threw six interceptions in his previous game against UCLA, piled up yardage in small chunks with swing passes to Karl Williams, Poole and Anderson.
The trio combined for 16 catches and 177 yards.
"We wanted to spread the ball out to the perimeter," Wilson said. "Stanford does a real good job of stuffing up the middle of the field, so we spread the ball to the perimeter. That ultimately opened up our run game."
Though none of the Utes' six second-half drives found the end zone, they kept Hogan on the sideline. Hogan, who lost for the first time in 11 games as a starter, threw a 7-yard touchdown pass to Cajuste with 9:22 to play.
Hogan moved the Cardinal 82 yards on 13 plays late in the fourth quarter, but his final pass sailed out the back of the end zone. Hogan completed 15 of 27 passes for 246 yards, but Stanford's 21 points and two offensive touchdowns were both season lows.
"They are a good team and have always been a good team," Stanford coach David Shaw said. "This is the best I have seen them play this year. Everyone in our conference knows that this is one of the toughest places to play.
"We missed tackles and didn't play well enough. Good teams play hard and smart, and we didn't do that tonight."
Utah's only other victory in eight previous games against a Top-5 team came in the 2009 Sugar Bowl against No. 4 Alabama. Saturday, the fans stormed the field to celebrate the school's first signature Pac-12 victory three years after joining the conference.
"It was a good night," Utah coach Kyle Whittingham said. "It's why you coach. I'm so happy for the players. The work they put in this past week has been outstanding."
The first quarter was a back-and-forth fireworks show.
Stanford's Tyler Gaffney scored on a 1-yard run on the Cardinal's opening drive and, after Utah answered with a 4-yard Wilson-to-Williams pass, Ty Montgomery silenced the home crowd with a 100-yard kickoff return for touchdown.
From there, the Ute defense settled in and the offense-controlled tempo. Utah's longest play of the game came late in the first quarter when Wilson connected with Anderson for a 51-yard touchdown pass on third-and-17.
"We are excited to win this game but it us what we expected to do, and now we have to keep moving forward," Anderson said.
Utah led 21-14 at halftime, its third touchdown drive helped by a roughing-the-passer call against Stanford's Ben Gardner on a third-down incompletion. Anderson scored on a 3-yard run.
Wilson finished 23 of 34 for 234 yards and two scores.
NOTES: Stanford's Tyler Gaffney (108 yards) was the first 100-yard rusher Utah has allowed this season. ... Phillips is 11 for 11 on field goals this season. The 48-yarder was a season long. ... Stanford allowed a touchdown in the first quarter for the first time this season. ... Utah has won 49 consecutive games when leading at halftime.