AUSTIN, Texas (CBSDFW.COM/AP) — Sam Ehlinger did what he usually does: throw for a bunch of touchdowns and deliver big runs. Put him together with more games like this from the Texas defense, and the Longhorns will go far in the Big 12 this season.

Ehlinger passed for four touchdowns for the third time this season, and the No. 12 Longhorns’ defense held Oklahoma State’s big playmakers in check for most of the game to slug out a tough 36-30 victory Saturday night to open the Big 12 schedule.

Texas (3-1, 1-0) ended a four-game losing streak to the Cowboys (3-1, 0-1) and ended a five-game skid in the series in games played in Austin dating to 2010.

To do it, the Longhorns had to overcome three turnovers, including Ehlinger’s first interception of the season, and needed his clock-killing 29-yard run in the final minute to put the game away.

“Once I knew I had the first down and the game was over, it was an incredible feeling,” Ehlinger said. “You say you want to win at home.”

But it was the Texas defense that coach Tom Herman praised.

The Longhorns held Chuba Hubbard, the nation’s leading rusher coming into the night, to 121 yards on 37 carries and a long run of 13 yards. He scored twice but was also stuffed near the goal on key drives early and late.

Tylan Wallace, who came in tied for the national lead with six touchdown receptions, didn’t find the end zone against the Longhorns and had just two catches in the second half.

“The two guys were really hard to stop, I thought we did an admirable job of it”, Herman said. “That’s about as good as you’re going to do against those two guys. …We gave up big plays but bowed our backs when our back was against the wall.””

Hubbard’s second score got the Cowboys within a touchdown with 1:37 to play, but Texas recovered the onside kick. After two short runs, Ehlinger scrambled to his right to get the last first down Texas needed.

Ehlinger finished with 281 yards passing and had three touchdown passes in the second quarter, including a 73-yarder to Brennan Eagles.

Texas’ Keaontay Ingram rushed for 114 yards. His spinning, tackle-breaking 26-yard reception set up a touchdown that gave Texas a 13-point lead early in the fourth quarter.

The Longhorns will take on West Virginia Oct. 5.

(© Copyright 2019 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)