Jarret Doege threw three touchdown passes, Leddie Brown ran for two scores and West Virginia upset No. 22 Iowa State 38-31 on Saturday.

West Virginia (4-4, 2-3 Big 12) came alive on offense after averaging 20 points in its first four conference games.

Iowa State (5-3, 3-2) was missing leading tackler Mike Rose because of an undisclosed injury and the league’s top defense gave up a season-high 492 yards. The linebacker had started all 45 previous games in his career. The Cyclones had kept their seven previous opponents under 350 yards.

Breece Hall rushed for 167 yards, including a 70-yard TD on Iowa State's third play from scrimmage. But he fumbled reaching for the end zone in a pile of players for the potential tying touchdown with about 6 minutes left and West Virginia's Alonzo Addae recovered. The play held up upon review.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

West Virginia punted on its next series to give the Cyclones one last chance.

Brock Purdy ran for 14 yards on third-and-15 to the West Virginia 25. A false-start penalty then pushed Iowa State back. With no time left, Purdy threw into a crowd in the back of the end zone and the ball was batted away incomplete.

Purdy, pressured around the pocket all game, finished 16 of 27 for 185 yards. He threw for one score and ran for another. Iowa State fell to 12-3 with Purdy in October and 16-3 during the month dating to 2017.

Doege completed 30 of 46 passes for 370 yards. He threw two interceptions, one on a deflected pass.

Brown finished with 109 yards, including a pair of 2-yard touchdown runs. West Virginia improved to 9-1 when Brown surpasses 100 yards rushing over his career. He was held under 50 yards in two previous meetings against the Cyclones. Iowa State had not allowed a 100-yard rusher this season.

Tied at 17 at halftime, the teams took turns trading big plays on both offense and defense.

After Bryce Ford-Wheaton was flagged for pass interference and the Mountaineers were penalized for a delay of game on consecutive plays, linebacker Jake Hummel then intercepted Doege and went 24 yards untouched into the end zone to put the Cyclones ahead 24-17.

Ford-Wheaton made up for his gaffe on the next series, reaching high to catch a 23-yard pass and tapping a toe in the back of the end zone for a touchdown that held up under review.

Hall swung the momentum right back to the Cyclones, going through a huge hole and dragging defenders with him on a 53-yard run that set up Purdy's 1-yard scoring run for a 31-24 lead late in the third quarter.

Doege hit Winston Wright with a 22-yard scoring dart on fourth down on the next series and, after an Iowa State punt, Ford-Wheaton made a 45-yard reception to set up Brown's 2-yard run for a 38-31 lead with 9:25 left.

POLL IMPLICATIONS

Iowa State will likely fall back out of the AP Top 25 poll after rejoining the rankings last week.

UP NEXT

Iowa State: Hosts Texas next Saturday.

West Virginia: Hosts No. 15 Oklahoma State next Saturday.