Jordan Shipley returned a punt for a touchdown in the fourth quarter for the Longhorns (5-0, 2-0 Big 12), who can now look ahead to next weekend's showdown with No. 19 Oklahoma.
Colorado (1-4, 0-1) led 14-3 behind tough defense and two first-half touchdown passes by Cody Hawkins that quieted the home crowd and even drew some boos.
Shipley caught a 39-yard TD with 46 seconds left in the first half and Wells' touchdown on the punt block by Marquise Goodwin put Texas up 17-14 in the third before Thomas' interception return.
Colt McCoy was 32 of 39 passing for 265 yards with one touchdown and one interception for Texas.
Defensively, Texas held Colorado to 127 total yards, but it was a much tougher win than expected. The Buffaloes may have caught the Longhorns looking ahead to their annual grudge match with Oklahoma in Dallas.
Hawkins, who was pulled after the interception return in the third, was sharp early, fooling Texas on the two play-action passes for touchdowns. The first to Patrick Devenny capped Colorado's first drive. The second to Riar Greer came in the second quarter after McCoy fumbled on the Longhorns 6.
The Buffaloes also blocked a Texas field goal attempt in the second quarter. The Longhorns' 313 total yards was their lowest output of the season and 200 below their average.
But McCoy to Shipley can cure a lot of ills.
Shipley, who caught 11 passes for 147 yards, was wide open when he turned Colorado cornerback Jalil Brown on a fake to the inside and McCoy hit him in stride for Texas' first touchdown with 46 seconds left in the half.
It didn't solve everything. Texas' first two drives of the second half ended without reaching midfield and Longhorns fans started booing in frustration.
Texas finally put the game away with the TDs on special teams and defense.
Goodwin, a freshman who was a high school track star with world-class speed in the 100 meters, turned the game with one 12-yard burst when he ran through the right side of Colorado's punt protection to get a clean block on the kick.
The ball spun backward toward the end zone and sat up neatly for Wells to scoop up and score from the 3 for a 17-14 lead.
Colorado was still in the game when Brown intercepted a tipped pass deep in Texas territory. Hawkins then rolled to his right but threw behind his receiver, making it an easy pickoff for Thomas and the safety sprinted along the sideline to the end zone.
The 92-yard return tied for the second-longest in Texas history and was the longest for the Longhorns since 1937.Shipley made it 31-14 with his punt return, weaving through the middle of the field for about 20 yards before breaking to his left to find a clear path to the touchdown.