Coach Charlie Strong's Longhorns (2-4, 1-2 Big 12) came to Dallas in the midst of the program's worst start in 59 years and as a two-touchdown underdog to the Sooners (4-1, 1-1). It's been nothing but turmoil and excruciating losses for the Longhorns so far, but Strong's defense harassed Oklahoma quarterback Baker Mayfield and the offense made just enough plays to show Texas fans that better times might not be so far away.
Jerrod Heard mostly guided the Texas offense with 168 total yards, and Tyrone Swoopes played finisher near the goal line. His 2-yard touchdown flip to Caleb Bluiett with 13:52 left in the fourth quarter made it 24-10.
Oklahoma responded with a long touchdown drive capped by Samaje Perine's 1-yard touchdown run to cut it to 24-17 with eight minutes left.
The Sooners got the ball back with 6:05 remaining, but two sacks, the last by Naashon Hughes and Poona Ford, forced OU to punt. The Longhorns then killed the clock, with Heard providing the final two first downs.
Texas is now 6-2 since 1989 in Red River games in which it was unranked and the Sooners were ranked. The Longhorns finished with 55 passing yards, their fewest in a win since 1970.
The Longhorns fans were slow filling their half of the Cotton Bowl as kickoff approached. There was also a little more room to spread out on that side of the stadium, with a smattering of empty seats. Confidence was not high among the Longhorns, but the Sooners were wary.
Before the game, an OU fan waiting for an elevator with a group of Texas fans said: "This reminds me too much of two years ago."
In that game, Texas came in 3-2 with coach Mack Brown's future in doubt and won 36-20. The win provided some temporary joy in a tense season for Texas that ultimately ended with Brown stepping down under pressure.
Year 2 under Strong has gotten off to an even worse start than Year 16 under Brown, but that worried Sooners fan seemed prescient when Texas jumped out to a 14-0 lead in the first quarter behind a fired-up defense.
Texas swarmed Mayfield on a third-and-long, and Strong was 10 yards on to the playing field to greet his defense with hand slaps and pats on the back. It was the first of five sacks in the first half.
The Longhorns offense fed off that energy. They took the lead on a 24-yard shovel pass sweep from Heard to Marcus Johnson. Oklahoma fumbled away the ensuing kickoff, and Texas turned the short field into another touchdown.
The Sooners came to life in the third quarter. Mayfield threw a low strike in the end zone to Dimitri Flowers from 3 yards out to cut Texas' lead to 17-10 with 5:16 left in the third.
Texas responded when D'Onta Foreman broke free of a tackle at the line and raced 81 yards on the final play of the third quarter. The 11th-longest run in Texas history set up the Longhorns at the Oklahoma 10, and the UT fans spent commercial break volleying "Texas!" "Fight!" across the Cotton Bowl.
Soon after, Swoopes flipped a jump pass to a wide-open Bluiett in the end zone to make it 24-10 with 13:52 left.
The Texas-Oklahoma game is not the biggest game in the Big 12 these days as it was when Brown and Oklahoma's Bob Stoops owned the Big 12 during most of the 2000s. Baylor, TCU, Oklahoma State and Kansas State have all won the conference since 2011. Texas has not, and the best Oklahoma has done is a share in 2012.
These days, the game has been more about temporary relief and avoiding disappointment than determining championships.
Strong and the Longhorns left the Cotton Bowl feeling better and thinking that they could salvage the season.
Stoops and the Sooners head back to Norman with another loss in a game they were favored to win, looking nothing like a team that can keep Baylor and TCU from deciding the Big 12 again.
The Associated Press and ESPN Stats & Information contributed to this report.