The clash between the two top rushers in the Mountain West - San Diego State's Donnel Pumphrey and Ajayi - lived up to its billing. Pumphrey rolled up 147 yards on 24 carries with two touchdowns.
Boise State (8-2, 5-1) is tied with Colorado State atop the Mountain West Mountain Division while San Diego State (5-4, 3-3) remains in contention to win the West division.
Trailing 23-10 late in the third quarter and struggling on offense, Boise State sparked its comeback with a fake punt.
Facing a fourth-and-four from its own 32, Chris Santini took a direct snap and raced 24 yards for a first down. Eight plays later, Ajayi scored on a five-yard run to cut San Diego State's lead to 23-17.
With 37 seconds left in the third quarter, Boise State's Cleshawn Page intercepted San Diego State quarterback Quinn Kaehler at the Aztec 34 and returned it to the 14. Three plays later, Ajayi scored on a 3-yard run with 14:56 left. Dan Goodale's extra point gave Boise State its first lead of the game at 24-23.
Ajayi scored again on a 10-yard run with 11:23 remaining, pushing Boise State's lead to 31-23.
But San Diego State answered when Pumphrey scored on a 34-yard run with 8:37 left. However, the Broncos' defense stuffed San Diego State's Chase Price on the goal line on the two-point conversion attempt to maintain a 31-29 lead.
Boise State's Grant Hedrick scored on a 13-yard run with 2:01 remaining to secure the victory.
The 9 degree Fahrenheit temperature at kickoff was the coldest in San Diego State program history, but it didn't seem to bother the Aztecs early.
San Diego State rode Pumphrey early to build a 10-0 lead in the first quarter. After a 41-yard field goal by Donny Hageman gave the Aztecs a 3-0 lead, Pumphrey scored on a 32-yard run with 1:16 left in the quarter.
Hageman tacked on a 30-yard field goal two possessions later to push the Aztecs' lead to 13-0.
San Diego State's good fortunes continued when J.J. Whitaker intercepted a pass on the Aztecs 40 and returned it to the Boise State 34. Three plays later, Dani Brunskill caught a 6-yard touchdown pass from Kaehler to extend San Diego State's lead to 20-0 with 7:33 remaining in the first half.
Boise State, which could only muster 37 yards through its first five possessions, rolled up 136 yards on its final two possessions of the second quarter and scored twice before halftime to stay in the game.
After a 73-yard drive that stalled at the San Diego State 4, Dan Goodale hit a 21-yard field goal to cut the Aztecs' lead to 20-3 with 3:25 remaining in the half.
On Boise State's next possession, Hedrick engineered a six-play, 78-yard drive that ended in a 14-yard touchdown pass to Thomas Sperbeck with 17 seconds remaining. Goodale's extra point trimmed the San Diego State lead in half at 20-10.
On the Aztecs' first possession of the second half, Hageman hit a 44-yard field goal to push the San Diego State lead to 23-10.