STILLWATER, Okla. (KXAN) — The No. 20 Texas Longhorns looked great leading the No. 11 Oklahoma State Cowboys 31-17 late in the second quarter. But unfortunately for the Longhorns, they had to play a second half Saturday at Boone Pickens Stadium.

Texas blew its two-touchdown lead and snatched defeat from the jaws of victory, falling to the Cowboys 41-34 behind an offensive meltdown in the second half after they looked tremendous in the first half.

The Longhorns were penalized 14 times for 119 yards and Oklahoma State didn’t get flagged once all game, and some of those forced the offense into bad situations, but in the end, Texas didn’t make the plays it needed to in the second half on both sides of the ball.

On the final play of the game for the Longhorns, Quinn Ewers threw it over the middle to an open JT Sanders, but the pass bounced off Sanders’ hands and fell into the waiting arms of Oklahoma State’s Kendal Daniels. It was a microcosm of Ewers’ struggles throwing the ball and the general tone of the second half for Texas.

In the first half, the Longhorns looked like they exorcised previous demons on the road. Three explosive plays on offense plus timely defensive plays staked Texas to the two-touchdown lead with about 3:00 left in the half. Things weren’t perfect by any means, but the Longhorns were in a good spot.

After flirting with taking the lead for much of the second half, Oklahoma State finally got it done with 3:09 left. Spencer Sanders, who had struggles of his own but made plays when his team needed them, hit Bryson Green with a 41-yard touchdown pass. Green finished the game with five catches for 133 yards.

On the previous possession, Texas kicker Bert Auburn missed a 46-yard field goal try that would have given the Longhorns a 3-point lead. During that drive, Ewers floated a deep pass into the end zone intended for Worthy, but the otherwise steady Longhorns receiver tripped trying to run underneath the pass and it fell to the ground.

MORE THAN THE SCORE: Stay up to date on sports stories like these, and sign up for our More than the Score sports newsletter at kxan.com/newsletters

The Ewers-Worthy connection had a tough day. Worthy was targeted 16 times and had just four catches, and many of those missed targets were overthrows by Ewers or apparent confusion by Worthy and other receivers. The duo didn’t look in sync at all like they had been previously this season.

Ewers finished the game completing 19 of 49 passes, a 38% completion rate, for 319 yards with two touchdowns and three costly interceptions. Worthy had 78 receiving yards and a 12-yard touchdown catch in the first quarter when the Longhorns looked tremendous.

Explosive plays were the Longhorns’ calling card in the first half with three scoring plays over 40 yards. Bijan Robinson had two of the plays, breaking off a 42-yard run for the first score of the game and then a 41-yard touchdown reception to give the Longhorns a 29-10 lead early in the second quarter.

Robinson finished with 181 total yards, 140 on the ground and 41 on the lone catch. Robinson packed the ball 24 times and averaged nearly six yards per carry and had his sixth consecutive 100-yard rushing game. Roschon Johnson scored on a 52-yard run with 3:43 left in the second quarter to give the Longhorns a 31-17 lead. He had five carries for 73 yards on the day.

For Oklahoma State, Sanders gutted out his shoulder injury and played well. He completed 34 of 57 passes for 391 yards with two touchdowns and an interception. Sanders added 43 yards on 11 carries, mostly scrambles, with a long run of 16 yards. Jaden Nixon led the ground attack for the Cowboys with 64 yards on eight carries, but Dominic Richardson scored three times on runs of 4, 1 and 2 yards. He finished with 24 yards on 13 carries.

Texas (5-3, 3-2 Big 12 Conference) has a bye week coming up to think things over and clean up the mess that was this game. Oklahoma State (6-1, 3-1) stays in the hunt for a conference championship game berth with a win and takes on Kansas State in Manhattan, Kansas next week.

Game log

Final: Oklahoma State 41, Texas 34. The Longhorns blow another big lead on the road and just flat-out didn’t play well enough to win in the second half. Awful loss.

0:09 4Q: Ewers’ pass bounces off JT Sanders’ hands and it’s picked off by OKST’s Kendal Daniels. That’ll do it. The Cowboys are going to win this ballgame

1:00 4Q: OKST does, in fact, punt. Hutton sort of shanks it a bit and it’s marked out of bounds at the Horns’ 24. Here we go.

1:07 4Q: Texas gets a stop on 3rd down and Sarkisian calls the final timeout. It’s 4th-and-4 now and a punt, at least that’s how OKST is lined up, is coming.

1:54 4Q: That holding penalty on Christian Jones puts Texas’ penalty yardage over 100 yards. 12 penalties for 109 yards. Absolutely killer and wiped out an impressive scramble by Ewers

3:09 4Q: Bryson Green has been great all game for the Cowboys, and that’s the biggest play of this one. It’s a 41-yard TD pass from Sanders. PAT good. 6 plays, 72 yards, 1:48. Cowboys 41, Longhorns 34

4:57 4Q: Auburn yanks the 46-yard field goal try left. No good. OKST takes over on their own 28

5:03 4Q: Worthy trips coming out of a move and the ball falls to the ground. Ewers had him open in the end zone. Wow. It’s 4th down and here comes Auburn

7:59 4Q: Credit to the Longhorns defense for forcing a quick 3-and-out by the Cowboys, and the Horns get it back on their own 22 after the punt. OKST has run 88 plays to UT’s 61. This game has UT-TTU qualities to it.

8:38 4Q: Trejo’s punt isn’t that great and the Cowboys have good field position to start the drive on their own 36.

9:54 4Q: Sanders hits Brennan Presley with a 10-yard TD pass. Wide open in the middle of the end zone. PAT good. 12 plays, 66 yards, 4:53. It’s a tie ballgame, folks Longhorns 34, Cowboys 34

11:54 4Q: The seas part and Spencer Sanders is left all alone to scramble for the 1st down. 7-for-16 on 3rd down now are the Cowboys.

14:47 4Q: Longhorns have to punt and OKST will start its first fourth-quarter possession at their own 34-yard line.

End 3Q: Longhorns 34, Cowboys 27. Ewers fumbled the last two snaps of the quarter. Bizarre. Horns have it 3rd-and-10 on their 25 to start the 4Q

0:29 3Q: Tanner Brown hits a 40-yard field goal for OKST. Longhorns 34, Cowboys 27. For the betting types who took the over, you can relax now.

2:10 3Q: Someone finally gets on the board in the 2nd half. Bert Auburn knocks in a 33-yard field goal to extend the lead. Longhorns 34, Cowboys 24

3:17 3Q: Horns with prime field position after Worthy returns the OKST punt 30 yards to the OKST 20. OKST was punting out of its own end zone.

5:12 3Q: UT’s Daniel Trejo hits a punt as perfectly as possible and it lands out of bounds inside the 1-yard line. Wow. Cowboys take over there.

7:04 3Q: All of a sudden, the offenses come to a screeching halt. Both teams have punted on every possession in the second half. Texas will take over on its own 20.

11:54 3Q: Oklahoma State can almost count on Longhorns defenders committing pass interference at this point, Jamison gets flagged for one, the 11th penalty on Texas today.

12:26 3Q: Both teams traded punts to open the second half. UT’s Daniel Trejo pins the Cowboys inside their own 10

14:25 3Q: The Big 12’s tackling leader Jaylan Ford finds Sanders in the backfield and brings him down for a sack on 3rd down. Cowboys have to punt.

Halftime: Longhorns 31, Cowboys 24. Poor clock management by OKST costs them at the end of the half, but they’ll get the ball to start the 2nd half. Penalties are killing Horns. 10-72 in 1st half. OKST hasn’t been flagged.

0:03 2Q: Interesting clock management by OKST there at the end of the half … and by interesting I mean not very good. Timeouts aren’t good in your pocket. Tanner Brown misses a 48-yard field goal, breaking his streak of 16 made kicks in a row.

1:08 2Q: Both Ryan Watts and Ovie Oghoufo went down on the field with injuries. Watts got up relatively quickly but Oghoufu is still down and being looked at by medical staff. Looks like it’s a left arm injury.

Texas has to punt and Oklahoma State has more than enough time to potentially tie the game before halftime, and the Cowboys will receive the second-half kick. This drive could be a big one if the Cowboys get points.

2:41 2Q: Richardson plunges into the end zone from 2 yards out. 3 plays, 85 yards, 0:57. PAT good. Longhorns 31, Cowboys 24

3:10 2Q: OKST finally gets a big play out of its run game. Jaden Nixon loses a shoe but still goes 51 yards and gets the ball to the Texas 11-yard line

3:43 2Q: Roschon Johnson bursts through the line for a 52-yard TD run on another explosive play out of the run game for the Horns. 7 plays, 80 yards, 1:32. PAT good. Longhorns 31, Cowboys 17

4:20 2Q: Ewers throws a laser over the middle to JT Sanders for another 3rd down conversion. This was right after Ewers threw a bad pass intended for Worthy that was almost picked off

5:15 2Q: Texas DB Ryan Watts makes a huge play and picks off Sanders in the end zone. Everything was going OKST’s way on that drive and Watts shut it down. Texas to take over on its own 20

8:04 2Q: Bert Auburn knocks a 38-yard field goal through. Longhorns 24, Cowboys 17

8:47 2Q: Penalties are killing Texas right now. Another false start penalty gives the Horns 60 penalty yards on 8 flags.

11:16 2Q: Richardson is untouched on the short TD run. PAT good. 8 plays, 75 yards, 2:12. Longhorns 21, Cowboys 17

12:26 2Q: Sanders goes down to slide and Anthony Cook gets called for unnecessary roughness with the hit as Sanders gets down. Officials review for targeting and they say it’s not. Break for Texas to keep Cook in the game.

13:29 2Q: Bijan Robinson does it again, this time with a 41-yard reception for the TD. Complete breakdown in OKST’s coverage and he was so wide open that he looked sort of confused going into the end zone. PAT good. Longhorns 21, Cowboys 10

14:06 2Q: Morice Blackwell blocks the OKST punt and Anthony Cook jumps on it and the Longhorns take over on the OKST 42-yard line

End 1Q: Longhorns 14, Cowboys 10. OKST has it 2nd-and-9 on their own 29 to start the 2Q

2:10 1Q: Texas is now 0-for-4 on 3rd down after three incompletions where it didn’t appear Ewers and the wideouts were exactly in sync. Texas punts and pins OKST on their own 8-yard line

4:21 1Q: Really great play call there. Ewers swings it out to Worthy on a misdirection-type pass for a 12-yard TD. Worthy had it in open space and made one guy miss. 4 plays, 52 yards, 1:51. PAT good. Longhorns 14, Cowboys 10

6:12 1Q: OKST punts and Xavier Worthy returns it to the Texas 48-yard line. Nice return there by Worthy

7:07 1Q: The miscue ends up not hurting the Cowboys as they stuff the Longhorns on 4th down. Taylor makes another big play for the Cowboys on defense. OKST takes over on their own 28-yard line

8:37 1Q: Officials rule that the Texas punt hit the Oklahoma State punt returner, but reviewing the replay, the call stands. Texas gets a break and takes over at the Cowboys’ 35-yard line

9:39 1Q: Dominic Richardson with a 4-yard TD run for the Cowboys. A 40-yard pass from Sanders to Bryson Green, plus a couple of penalties, set it up. 6 plays, 75 yards, 2:22. PAT good. Cowboys 10, Longhorns 7

10:42 1Q: Texas DB D’Shawn Jamison gets beat to the inside and Sanders finds Bryson Green for a 40-yard gain.

12:01 1Q: Bijan Robinson showed a little bit of everything on that 42-yard touchdown run. His lateral quickness while navigating the first level, and then running away from everyone once he got to the second level. 4 plays, 71 yards, 1:14. PAT good. Longhorns 7, Cowboys 3

13:21 1Q: OKST’s Tanner Brown hits a 48-yard field goal to open the scoring. The Texas defense was great on that drive and actually made the Cowboys go backward for two yards before the field goal try. Cowboys 3, Longhorns 0

14:31 1Q: On 3rd-and-6, Quinn Ewers throws an interception to OKST’s Jason Taylor. It’s Ewers’ third interception of the season. Cowboys take over on the Longhorns’ 28-yard line

15:00 1Q: Oklahoma State wins the coin toss and defers its choice to the second half. Texas receives the opening kick