Mikala Compton/Austin American-Statesman / USA TODAY NETWORK

Quinn Ewers passed for two touchdowns -- including the game-winner to Xavier Worthy early in the fourth quarter -- as No. 4 Texas produced a ragged performance but did enough to beat visiting Wyoming 31-10 on Saturday in a battle of undefeated teams in Austin, Texas.

Ewers finished with 131 yards through the air and ran for a 5-yeard score as the Longhorns (3-0) struggled with execution and played like they had a bit of a hangover after their huge win at Alabama on last Saturday.

Jonathon Brooks ran for career-best 164 yards on 21 carries, highlighted by a 61-yard jaunt to the Wyoming 5-yard line in the fourth quarter as Texas put some distance between itself and the feisty Cowboys.

Jerrin Thompson added a 27-yard pick-six for Texas with 8:46 to play.

Harrison Waylee ran for 110 yards and a score on 18 totes for Wyoming (2-1). Evan Svoboda, who started in place of regular first-team signal caller Andrew Peasley, hit on 17 of 28 throws for 136 yards and Thompson's interception.

The Cowboys shocked Texas early when Waylee, a transfer from Northern Illinois seeing his first action of the season, ripped off a 62-yard TD to give Wyoming a 7-0 lead just 2:15 into the game.

The Longhorns responded via a 37-yard field goal by Bert Auburn with 9:46 to play in the first quarter. Texas' scoring drive began with a 20-yard punt return by Worthy that gave the Longhorns the ball at the Wyoming 38.

Texas took a 10-7 lead on Ewers' 1-yard pass to defensive lineman Byron Murphy II out of the jumbo set with 11:45 to play in the second quarter. The Longhorns used 17 plays and ran 8:03 off the clock bridging the first and second quarters to march 90 yards, converting two fourth downs along the way and getting a 14-yard Ewers-to Gunnar Helm pass to put them on the 1-yard line.

Wyoming tied the game with 36-yard field goal by John Hoyland with 20 seconds to play in the third quarter to culminate a 17-play, 77-yard drive that ate up 10:22 of the quarter.

But the Longhorns finally awoke from their offensive slumber, with Ewers hitting Worthy on a swing pass to the right flat that the speedster turned into a 44-yard TD on third snap of the fourth quarter.

More must-reads:

TODAY'S BEST
Mavericks advance to Western Conference Finals aided by controversial call late
Connor McDavid, Oilers hammer Canucks to force Game 7
Tyson Fury-Oleksandr Usyk epic increases excitement for potential rematch
Seize the Grey wins in muddy Preakness
Even Mike Budenholzer admits the Suns need a point guard
Watch: Juan Soto's first multi-homer game as a Yankee
Xander Schauffele, Collin Morikawa lead at PGA Championship
Knicks could get major boost for Game 7 showdown with Pacers
Giants All-Star pitcher suffers setback in recovery from injury
Panthers star named winner of 2024 Selke Trophy
WNBA to investigate $100,000 sponsorship deals for Aces players
Tiger Woods blames one big factor for missing the cut at PGA Championship
'Ain't good enough': Draymond Green claims Celtics must 'win it all' or it's a 'failure'
Blue Jays GM wants struggling club to feel 'massive sense of urgency'
Raptors expected to flip former NBA champion during the offseason
MLB insider reveals Mets' massive extension offer that Pete Alonso turned down
Celtics legend provides update after gruesome finger injury
Bulls hire former NBA head coach as top assistant
Chiefs move on from young running back
20-year MLB veteran working out, unsure about playing future