STORRS, Conn. -- Jonathan Holmes wasn't Texas' first option on its final play against UConn.
He turned out to be a pretty good one.
Holmes hit a 3-pointer from the left baseline with 2 seconds left and the seventh-ranked Longhorns beat No. 24 UConn 55-54 on Sunday to remain undefeated.
Connor Lammert found Holmes on an inbound pass as he came off a screen from Demarcus Holland. UConn's Ryan Boatright went to the floor after rolling his left ankle trying to switch onto Holmes, leaving the Texas forward with an open shot.
"The first look was for Myles (Turner) slipping to the basket," Holmes said. "The second was for me getting screened into the corner, and that was about as open as you could hope for."
Holmes had 13 points and eight rebounds to lead the Longhorns (6-0). Demarcus Holland and Javan Felix each added 10 points.
Boatright had 24 points and seven rebounds for UConn (3-2), which lost its second consecutive game. Freshman Daniel Hamilton added 13 points and seven rebounds.
Boatright had rolled the same ankle earlier in the game, but joked that he did not feel any pain until he saw the final shot go through the basket.
"When I realized my man was setting the screen, when I planted to go back the other way, it just turned and it gave out," he said.
He called it a "normal" ankle sprain. It's not clear whether he will miss any games.Boatright emerged from the locker room after the game on crutches with ice on his left ankle.
When asked how he felt, Boatright told ESPN, "It hurts." As to how serious he viewed it, he said to ESPN, "I'm a dawg, I'll be back."
UConn coach Kevin Ollie said during the postgame news conference that Boatright would be assessed but was optimistic.
"We will see but he hates to miss practice," Ollie said.
The Huskies led by six points with just over 6 minutes left, but missed their final eight shots from the floor. The Longhorns chipped away and called a timeout with 4.4 seconds left to set up the final play after Boatright missed the back end of a 1-and-1 at the free-throw line.
"I told the team in the locker room that the only time they really listened and did what we asked was the last play," coach Rick Barnes said. "But up until that point I kept looking at the guys and said, What are we doing?"
The Longhorns led most of the way before allowing an 11-1 second-half UConn run, sparked when Kendal Yancy was hit with a flagrant foul for throwing an elbow.
Boatright tied the game at 41 on a fast-break layup, which brought the sellout crowd into the game. He hit another layup to give the Huskies a 43-42 lead with 11 minutes left, their first since early in the first half.
Texas trailed by a point when Myles Turner blocked a Boatright layup with 56 seconds left. But backup point guard Felix, playing for an injured Isaiah Taylor, threw the ball away and was forced to foul Boatright on the inbounds pass.
The Huskies' senior leader hit both ends of a 1-and-1 to give UConn a 53-52 lead.
Felix then hit a layup on the other end to make it 53-52.
"We got it back at the end," Felix said.
Texas fell behind 4-0, but then reeled off 10 straight points, holding the Huskies without a basket for six minutes in the first half.
TIP-INS:
UConn: The Huskies lost for the first time in 45 consecutive nonconference games at Gampel Pavilion. The Huskies, who play about half of their home games on campus and the other half in Hartford, last loss in Storrs to nonconference foe in 2001. That came against Detroit-Mercy in the NIT tournament. UConn has just five regular-season games left at Gampel Pavilion this season.
Texas: Had held its first five opponents to an average of 52 points a game, and has not given up more than 57 this season. The Longhorns' opponents had been shooting under 30 percent from the field. They held UConn to 30.4 percent.
UP NEXT:
Texas returns home to face Texas-Arlington on Tuesday, before heading back on the road to face No. 1 Kentucky on Friday.
UConn is at home again Friday against in-state rival Yale.
STATS: The Longhorns were playing their third game since Taylor broke his left wrist. They had 13 turnovers, leading to 16 UConn points and shot just 37 percent from the floor. They also were outrebounded 36-35, after coming into the game averaging 14 more rebounds than their opponents.
SIBLINGS: Texas coach Rick Barnes is familiar with UConn freshman Daniel Hamilton. Hamilton's older brother, Jordan, played for Barnes and the Longhorns.
ESPN.com's Andy Katz and The Associated Press contributed to this report.