Updated

DALLAS (AP) -- Tyrone Swoopes threw a touchdown pass and ran for another score as Texas found relief in the Red River rivalry yet again, upsetting No. 10 Oklahoma 24-17 on Saturday.

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 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 Swoopes played finisher near the goal line. His 2-yard TD 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 8:00 minutes left.

Oklahoma got the ball back with 6:05 left, 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 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 Longhorns but 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 very much 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 for the Longhorns 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 a fired-up 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, too. 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 a 3-yard touchdown plunge by Swoopes.

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 last play of the third quarter. The 11th longest run in Texas history setup 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 then 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