Cody Johnson ran for two touchdowns and No. 24 fought 17-16 victory.

Texas (2-0), coming off a 25-point drubbing of Rice, trailed 13-0 early in the second quarter before benching starting quarterback Garrett Gilbert, who had two completions and two interceptions on eight attempts.

Case McCoy and David Ash split time under center and played mistake free while letting the running game carry the load, as the Longhorns outgained their counterparts, 166-43, on the ground.

"We're going to do whatever we have to do to win," Texas head coach Mack Brown said. "It's not about a person. It's not about the fans. It's about winning a football game in Texas the hard way with a really young team against an older team."

Jake Heaps completed 22-of-38 passes for 192 yards and one touchdown but was picked off twice for the Cougars (1-1), who won at Ole Miss last week.

Johnson's second TD run on a four-yard draw gave Texas its first lead, 17-16, with 8:46 remaining in regulation.

BYU went three-and-out on its next possession, but forced a quick three-and- out to get the ball back with a little over six minutes to go.

There was no comeback to be had, as Heaps' heave down the right sideline was intercepted by Quandre Diggs, and Texas ran out the remainder of the clock to seal the win.

"We felt really good about our chances. We knew it would be a difficult game. ... But in this particular case, Texas' defense played really well in the second half," BYU head coach Bronco Mendenhall said.

Justin Sorensen hit field goals of 30 and 33 yards in the opening quarter while Texas spun its wheels on the offensive side.

After going three-and-out on the first two touches, Gilbert was intercepted on the next two possessions before getting pulled following another unsuccessful series.

By that time BYU was up 13-0 after Heaps found Ross Apo for a six-yard touchdown to cap a 12-play, 97-yard drive.

An Adrian Phillips interception deep in BYU territory set up Texas' only score of the first half -- Justin Tucker's 23-yard field goal.

The Longhorns stuck to the running game in the second half, and it worked to perfection on their opening touch, which Johnson finished by barreling into the end zone from a yard out.

BYU held the ball for the next six-plus minutes on a march that ended in another Sorensen field goal, this time a 32-yarder.

Johnson was stuffed on 4th-and-1 from the BYU 14 with 13:32 remaining in regulation, but Texas went to the well again and gave it Johnson for the go- ahead score a little later.

Game Notes

These two programs had only met twice before, with BYU winning in 1987 and '88...McCoy was 7-of-8 for 57 yards, while Ash was 2-of-3 for 35 yards...Malcolm Brown led the Longhorns with 68 rushing yards on 14 carries...J.J. Di Luigi was held to 39 yards on 14 carries for BYU.