J'Covan Brown nearly saved the Longhorns despite struggling with his shot most of the night.
His 3-pointer and slicing drive to the bucket allowed Texas to get within one possession with 30 seconds to play, momentarily quieting a packed house at Bramlage Coliseum.
Given a chance to potentially take the lead, though, freshman guard Myck Kabongo fumbled away the ball and Kansas State's Rodney McGruder scored on a breakaway dunk, capping a phenomenal performance and lifting the No. 25 Wildcats to an 84-80 victory Wednesday night.
"They simply overpowered us inside," Texas coach Rick Barnes said. "Not only their post guys, but their guards were able to get pretty deep with us."
McGruder scored a career-high 33 points and had eight rebounds for the Wildcats (13-4, 2-3 Big 12) while playing superb defense on Brown, who came into the game leading the Big 12 in scoring.
Brown finished with 22 points for Texas (12-6, 2-3), but the junior guard was just 8 of 28 from the field and 4 of 14 from beyond the arc.
"He's obviously a huge part of their team," Kansas State coach Frank Martin said. "When he gets going, they're real good."
Brown hit one of his 3s with 53.6 seconds left, drawing Texas to 80-76. He added another basket after Will Spradling made one of two foul shots to make it 81-78.
Even though Brown had struggled earlier, Martin and the Wildcats were under no illusions about who would be shooting those critical shots for Texas.
"He ain't missing those coming down the stretch," Martin said. "Outside of that, I was pretty pleased how we stuck to our disciplines."
On the Wildcats' next trip down court, Angel Rodriguez missed a pair of free throws and McGruder, a 76 percent foul shooter, also missed a pair. Sheldon McClellan's dunk at the other end made it 81-80 with 20.3 seconds left, but after Spradling knocked down the second of two free throws, Kabongo turned it over and McGruder threw down his dunk to seal it.
"We had a chance to win it," Barnes said. "We've played enough games now that we should be able to handle it."
The Longhorns wound up 19 of 21 from the foul line, while Kansas State went 21 of 39 — including 3 of 10 in the closing minutes, as Texas fought back into the game.
McClellan finished with 19 points for Texas, taking some of the pressure off Brown. Kabongo had 14 points, and Clint Chapman added 11 before fouling out in the closing minutes.
Kansas State threatened to put the game away early.
McGruder hit his first five shots, three of them 3-pointers, and Jamar Samuels asserted himself in the paint as the Wildcats pushed out to a 36-21 lead. McGruder was also getting it done on defense, frustrating Brown on the perimeter and forcing the Longhorns' other guards to score.
Texas ended up with 31 points off the bench.
The complexion of the game changed with 8 1/2 minutes left when McGruder picked up his second foul and took a seat. The Longhorns launched a 19-2 run to take their first lead of the game.
Martin attributed his team's lack of scoring to poor shot selection early in possessions.
"When that defense is set, you cannot score on the first pass," he said. "If I don't call a special play, we can't shoot it on the first pass. That's bad basketball. That gets you beat."
Kabongo got the Longhorns' run started with a field goal and Chapman scored the next seven points before McClellan got into the act. His shot from close range made it 36-32 with 4:22 left.
Kansas State finally ended a nearly 7-minute scoreless drought when McGruder checked back in and scored with 1:48 left in the half, putting the Wildcats ahead 41-40. Victor Ojeleye's put-back in the final minute sent the Wildcats into the locker room leading 43-42.
The game went back and forth the entire second half, neither team able to put together a run like they did in the first half. The biggest lead after the break was seven points.
With two straight losses now, Texas finds itself under pressure.
With the departure of Nebraska and Colorado, the 10-team Big 12 will have a reconfigured conference tournament. The top six seeds will have byes into the quarterfinals.
"We shot 46 percent, they shot 47. You look at the numbers in the paint, we got 30, they got 38," Barnes said. "We could go through and dissect every position, but I think both teams played as hard as they could and at the end they won the game."