AMES, Iowa -- It didn't matter how Texas beat Iowa State.
The Longhorns just needed to escape Ames with a win.
They survived -- in a way the seething Cyclones might never forget.
Case McCoy scored on a 1-yard plunge with 51 seconds left and Texas rallied to beat Iowa State 31-30 on Thursday night.
McCoy threw for 244 yards for the Longhorns, (3-2, 2-0), who will head into next week's game against Oklahoma with at least a share of first place in the Big 12.
"I'm really excited. I think I love comeback wins on the road more than anything in football," Texas coach Mack Brown said. "I just think I love them. It just says something about your toughness and your team and believing. We're getting back something we lost. We couldn't have done this the last couple of years."
The Cyclones might argue that they couldn't have done it Thursday night either without some huge breaks.
McCoy led Texas on a 75-yard drive in just under 3 minutes -- which was aided by two pass-interference penalties and two near fumbles by Johnathan Gray.
The first one was reviewed after Iowa State's Jeremiah George picked up a loose ball and started running the other way. But it remained Texas ball, much to the dismay of irate Iowa State coach Paul Rhoads.
Gray recovered his own fumble on the next play, and McCoy followed with the winning touchdown.
"To make a play on the 1-yard line with our backs against the wall...and (to) have it taken away from them, that's hard to express. You don't just put an arm around a guy and tell him it's OK when that happens to him," said Rhoads, his voice raising with each sentence. "I've got pretty good eyesight. The view I had of that gigantic screen in the north end zone showed a guy that was not down and our guy with the football."
Sam Richardson had 262 yards passing and Aaron Wimberly had 117 yards rushing and a touchdown for Iowa State (1-3, 0-1). The Cyclones dropped their 11th straight Big 12 opener -- but none as heartbreaking as this one.
"So proud of the effort my kids gave to win this football game," Rhoads said.
The chaotic final minutes capped a game in which momentum kept swinging back and forth.
Iowa State's energy was seemingly squashed when McCoy found John Harris for a 44-yard touchdown strike to end the first half.
The Cyclones revitalized a near-sellout crowd with the longest pass play in school history.
Richardson found Quenton Bundrage on a simple slant, and Bundrage beat the Texas secondary for a 97-yard score that gave Iowa State a 20-17 lead. Texas answered on a 6-yard TD run by Joe Bergeron -- which was set up by a pair of pass-interference calls that Iowa State fans also weren't too happy about.
"We're the least penalized team in the league coming into this game. There sure seemed to be a lot of hankies out there," Rhoads said. "I'm sure they made tremendous calls all night long."
Wimberly gave the lead back to the Cyclones after a fumble with 11:32 left. Cole Netten's 29-yard field goal made it 30-24 with 3:40 to go.
It wasn't enough though, as the Longhorns embarked on the winning drive that might end up saving their season.
"I thought when we forced the field goal ... and we had three timeouts in our pockets we would win the game. That's who we've been in in our past. I'm really proud of our guys," Brown said.
Jackson Jeffcoat's interception with 8 seconds left sealed the win for Texas. Gray had 89 yards rushing, including a 45-yard touchdown dash, for the Longhorns -- who've bounced back from ugly losses to BYU and Mississippi with two straight wins.
McCoy started for the second time this season in place of the injured David Ash, who was out with concussion-like symptoms, and helped put Texas take a 10-0 lead before Iowa State rallied for 13 straight points.
McCoy got the Longhorns the lead back with a desperation heave. He flung the ball almost blindly into the end zone -- and found Harris between three defenders to put the Longhorns up 17-13.
McCoy was far from perfect. But on a night when the Longhorns and Mack Brown desperately needed a victory, McCoy did just enough to help give them one.
Even if Iowa State likely didn't see it that way.
"I think adversity has already struck this team plenty of times and we keep finding ways to keep battling and staying together and sticking together," McCoy said.
Follow Luke Meredith on Twitter: www.twitter.com/LukeMeredithAP
Acho: Hunter picking an HBCU was never about money
Sam Acho reacts to Nick Saban's comments about Jackson State and why Travis Hunter chose a historically Black university over other programs.
History of Saban and Jimbo going toe-to-toe
Take a look back at the rising tensions over the years in the SEC between Nick Saban and Jimbo Fisher.
Nick Saban calls out Jimbo Fisher, other college football programs and one golfer doesn't much miss Phil Mickelson
College football's elite coaches trade words and more from our Quotes of the Week.
How waiving scholarship limits affects college football
Heather Dinich explains how the scholarship limit being waived affects how coaches build their rosters.
Nick Saban, Jimbo Fisher and the perfect college football feud for its time
The verbal battle between the Alabama and Texas A&M coaches is a product of a system with no rules or enforcement. It provided some offseason entertainment but is indicative of larger issues in the sport.
Roundtable: What does Jordan Addison's decision mean for USC, the Pac-12 and college football?
Star receiver Jordan Addison announced he'll transfer to USC, instantly upgrading new coach Lincoln Riley's already stacked offense. What impact will his decision have?