AUSTIN, Texas — Midway through the second quarter of their 17-16 win over BYU Saturday, the No. 24 Texas Longhorns were in desperate need of offensive consistency.

By that time, Texas starter Garret Gilbert was gone after throwing two interceptions.

Third-stringer David Ash wasn't much better before giving way to second-stringer Case McCoy.

In all, the Longhorns has just two first downs and 69 yards in the first 22 minutes of play and trailed 13-0.

For the remainder of the half, Gilbert tended his helmet on the bench and McCoy and Ash rotated nearly every other play.

"We didn't get off to the start we needed to. We needed a spark," Texas offensive coordinator Bryan Harsin said. "I think Case did a good job in doing that. It was the fourth or fifth drive when everyone started to pick it up a little bit and we got momentum and got going."

After a Jake Heaps interception deep in Texas territory, McCoy and Ash drove inside the BYU 10, but the Longhorns had to settle for a 23-yard Justin Tucker field goal.

Although the Longhorns managed to score, signs of offensive life were still weak.

At the half, the Longhorn offense had just 88 yards total offense and three first downs, while holding the ball for almost 14 minutes. The Longhorns had the ball seven times and five times went 3-and-out.

Also, they converted just 1-of-7 third-down situations and trailed 13-3 at the break.

The second half was a different story.

"We took the momentum in the second half against a very good Brigham Young football team," Texas head coach Mack Brown said.

After the Cougars stalled, McCoy and Ash engineered a seven-play, 62-yard drive to cut the lead to 16-10, and were poised to tie or take the lead early in the fourth quarter before losing the ball on downs on the BYU 13 after another lengthy drive.

"When Case came into the huddle he was a real leader," Texas freshman wide receiver Jaxon Shipley said. "He came in the huddle and pumped us up and told us to trust him, and that he would lead us down to the victory. He brought in a lot of energy."

The Longhorns eventually took the lead at 17-16 on their next drive when Cody Johnson capped a 52-yard drive with a four-yard run with 8:46 left in the game.

Texas went to the air sparingly in the second half, but when it did the Longhorns made it count. They were 2-of-3 in the third quarter and 5-of-6 in the fourth quarter.

For the game, McCoy completed 7-of-8 passes for 57 yards. As a team, the Longhorns tallied 298 yards total offense, including 201 yards in the second half. Also, the Longhorns finished with 11 first downs in the second half and held the ball for nearly 17 minutes.

In the second half, the Longhorns controlled the clock by grounding out 120 yards on 28 carries.

Gilbert completed just 2-of-8 passes for 8 yards before being benched, while Ash went 2-of-3 for 23 yards and had nine carries for 36 yards.