Ellis’ score, the first offensive touchdown by Fresno State in nearly nine quarters, capped a nine-play, 60-yard drive in the final 2 minutes.
Idaho had just taken a 20-16 lead, its first of the game, on Deonte’ Jackson’s 4-yard touchdown run with 2:01 remaining.
Fresno State (7-4, 5-3) began the winning drive on its 40 after Vandals kicker Trey Farquhar sent the ensuing kickoff out of bounds. Bulldogs quarterback Ryan Colburn had two scrambles for 18 yards and threw an 8-yard completion to A.J. Johnson, moving the ball to the Idaho 25.
On second-and-10, Colburn found Jamel Hamler open over the middle, and Hamler broke tackles and spun his way down to the 1 for a 24-yard gain. Following a Fresno State timeout with 18 seconds left, Ellis went over the pile for the winning score.
It was the Bulldogs’ first offensive touchdown since the third quarter of their 35-34 loss to No. 19 Nevada on Nov. 13.
Colburn finished 21 of 33 for 219 yards but was sacked five times and fumbled three times. Hamler led the Bulldogs with 71 receiving yards.
The Bulldogs played the second half without leading rusher Robbie Rouse, who still finished with a team-high 85 yards on 12 carries. Rouse, who suffered a broken hand during last week’s 51-0 loss to Boise State, exited Saturday’s game with injured ribs, coach Pat Hill said.
The loss knocked Idaho (5-7, 2-5) out of contention for its second straight bowl berth.
Fresno State got its only other touchdown on Travis Brown’s 30-yard interception return early in the third quarter.
The Vandals trailed 13-0 at that point but fought back thanks to Farquhar’s two field goals and Justin Veltung’s 84-yard kickoff return for a touchdown with 6:29 remaining.
After Fresno State’s Kevin Goessling kicked a 35-yard field goal, Veltung fielded a short kickoff and burst up the middle practically untouched to bring Idaho to within 16-13.
Idaho’s defense forced a quick punt, and Nathan Enderle directed a seven-play, 71-yard drive that culminated in Jackson’s go-ahead touchdown.
Enderle began the drive with a 21-yard completion to John Roberson before a 24-yard scamper by Kama Bailey brought the ball to the Bulldogs 16.
Enderle finished 20 of 35 for 197 yards and an interception while rallying the Vandals to 17 fourth-quarter points. He was sacked six times.
Fresno State outgained Idaho 371-210, but the Bulldogs hurt themselves with four turnovers.
On Idaho’s opening drive of the second half, Brown stepped in front of Enderle’s short pass intended for Roberson and returned it 30 yards for a touchdown.
Fresno State led 6-0 at halftime on two Goessling field goals, including a 30-yarder on the final play of the second quarter.