AUSTIN, Texas — As the clock ticked down with under 20 seconds left in the game, the Texas defense forced Baylor quarterback Charlie Brewer to sail multiple throws out of the end zone -- including the final pass attempt with one second on the clock -- in order to secure the team's sixth straight win of the season.

"(The defense) came up when they needed to. We know we have some work to do on that side of the ball in the fourth quarter,” Texas head coach Tom Herman said.

Texas has shown plenty of capability to win these close games in dramatic fashion and Saturday's game against the Bears was no exception.

On one hand, the Texas Longhorns entered Saturday with all the makings of a let down game. On the other hand... well that hand is attached to quarterback Sam Ehlinger’s throwing arm.

Ehlinger left in the middle of Texas’ opening drive to tend to a bloody hand. It was later confirmed that he injured his right shoulder and would undergo further evaluation at halftime. Ehlinger would officially be ruled out for the rest of the game.

"“When your starting quarterback goes out in the first drive I think it was, there could have been some panic, a little shock to everybody especially knowing they went down and scored after that,” Herman said.

RELATED | LIVE BLOG: No. 9 Texas Longhorns survives late Baylor push, wins 23-17

Backup quarterback Shane Buechele came in with under 11 minutes to play in the first quarter. With Buechele behind center, the Longhorns had two drives end in field goals by Cameron Dicker: one for 40 yards and another for 18.

“Shane Buechele is the most engaged and most prepared. He’s the most positive coaching backup quarterback I’ve ever been around in my life,” Herman said. "I don’t think there was any doubt in anybody’s mind how prepared (Buechele) was. What an unbelievable teammate he’s been, especially what’s gone on in other parts of the country.”

After the initial field goal, the Bears countered with a 12-play, 70-yard drive which Charlie Brewer capped off with a 19-yard touchdown pass to Denzel Mims -- his first catch of the game.

The Texas offense finally found some life with less than five minutes to play in the first half. Buechele found his longtime pal, wide receiver Collin Johnson, who hauled in a 44-yard touchdown pass to put Texas up 13-10.

As the first half wound down, Texas went with the ground game to move the sticks, finishing it off with a three-yard rushing touchdown by Lil’Jordan Humphrey to put Texas up by 10.

Then, after freshman safety Caden Sterns got Texas the ball back with an interception off Brewer, Dicker nailed a 47-yard field goal to give Texas a 23-10 lead at halftime.

The third quarter was uneventful until the 6:37 mark, when Buechele lobbed up an interception to a Baylor Bear. The pick would put the Bears at their own 44-yard line. A couple of plays later, Denzel Mims caught a 45-yard pass to put the Bears at Texas’ five-yard line and Baylor cashed in. Jalen Hurd rushed up the middle to pull the Bears within 23-17.

Texas had every opportunity to put the game away in the fourth, but Dicker, the Red River Showdown hero, did not show as much production late in this game against Baylor as he did the week prior. Dicker missed two field goals in the fourth quarter -- one from 34 yards and the other from 51. Dicker's missed field goals and a drive which ended with a punt kept the Longhorn lead at six points and Brewer had the opportunity to spoil Texas' season.

Starting on at their own three-yard line with no timeouts available, the Baylor Bears marched down the field on the final drive of the game. Brewer connected with Pooh Stricklin for chunks of 19 and 20 yards to cross the 50 as the clock ticked under a minute. An 11-yard run from Trestan Ebner followed by a nine-yard completion over the middle from Brewer to Chris Platt brought the Bears to the Texas 19-yard line.

Brewer spiked the ball on second down to stop the clock with 15 seconds to go and Baylor oddly chose to do a quarterback sneak to pick up the first down with no timeouts remaining. As the clock ticked under 10 seconds, Brewer rolled out and took a shot into the end zone, which fell incomplete. Brewer took two more shots at the end zone from Texas' 17-yard line, which both fell incomplete and the ground erupted in cheers as the Longhorns held on to win by six.

When asked about what he had to say to his defensive unit after Baylor had a shot to win the game, Herman had only two words.

"Great stop," Herman told the media.

Texas improved to 6-1 overall and 4-0 in the Big 12 Conference. The Longhorns will have a bye week and then will travel to Stillwater to take on the Oklahoma State Cowboys.