AUSTIN, Texas (AP) -- Wisconsin's Michael Flowers had two options with time running out: pass to tie, shoot to win.
Easy choice, really.
With a Texas defender leaving him room to shoot, Flowers swished a long 3-pointer with 2 seconds left to give the Badgers a one-point lead.
As if that weren't enough, he followed it with the defensive play of the game.
Flowers stole Texas' inbounds pass and tossed the ball high in the air as he tumbled toward the stands. Texas players, already stunned by the 3-pointer, could only watch as the last second ticked off the clock before the ball came down and Flowers was mobbed by his teammates.
Game over. Wisconsin 67, No. 9 Texas 66.
"I was laying for that steal all game and I finally got one on that inbounds pass," said Flowers, who had two steals and seven points. "I jumped and left my feet so I couldn't come down and call timeout. I just threw it straight up in the air and hoped time ran out."
The Badgers' final play was supposed to be set up for Brian Butch, the 6-foot-11 center who dominated Texas' interior with 21 points and 11 rebounds. Texas knew it was coming and smothered Butch, leaving Flowers open for the shot from about 22 feet.
"I don't think they were coming down looking for a 3-point shot," said Texas guard A.J. Abrams, who was defending Flowers. "He's a threat but we were playing for the drive. He just let it go and you've got live with it."
Abrams could have given Texas a 3-point lead moments earlier, but the 93 percent free-throw shooter missed the first of two with 11 seconds left.
"I don't miss too much from the line, when it didn't go in, it kind of shocked me," Abrams said.
Wisconsin (10-2) got the win despite playing without leading scorer Trevon Hughes, who spent the game on the bench with crutches and a boot on his right ankle.
Damion James scored 21 and grabbed 15 rebounds for the Longhorns (11-2), who have lost two in a row after their best start since the 1981-82 season. And just like in their loss against No. 7 Michigan State, Texas struggled to match up against a Big 10 team with size and muscle.
The Badgers outscored Texas 36-28 in the paint and grabbed 12 offensive rebounds in the second half. The Longhorns also struggled shooting free throws, hitting 6 of 12 from the line with several key misses in the final minutes.
"We've got to do the same thing we've talked about, post defense and rebound," Texas coach Rick Barnes said. "These two games, the thing that hurt us most was points in the paint."
Despite those struggles, Texas appeared likely to pull out the win behind James' superb scoring and rebounding when he zipped a pass to D.J. Augustin for a layup that put Texas up 61-56.
The final frenzy was just getting started.
Butch scored four straight points to give the Badgers a 62-61 lead before Augustin drove for a layup to put Texas up by one. After Butch missed the first of a 1-and-1 from the line, Abrams hit a 10-footer to make it 65-62 with a minute to play.
Marcus Landry's baseline jumper got the Badgers within 65-64, but when Abrams went to the line, it seemed like a lock that he'd give Texas a three-point lead. His first shot bounced off the back of the rim and his second only put Texas up by 2.
After Flowers hit the 3-pointer to give Wisconsin the lead, the Longhorns tried to catch the Badgers in the confusion of a celebration with a quick inbounds pass.
Flowers jumped the pass -- risking a foul that would have sent Texas back to the free throw line -- tipped it away and tossed it about 30 feet in the air.
"I always say make sure you throw the ball in the air," Wisconsin coach Bo Ryan said, "[And] the ball not hitting anything sealed the deal for us."
Augustin said he felt helpless as he watched the ball go up and the clock wind down.
"There was nothing we could about it. I was just in shock," Augustin said.
Before the game, Texas announced that freshman forward Gary Johnson had been cleared to play next Wednesday against TCU. Johnson has been allowed to practice but has been held out of games this season as doctors monitored an unspecified heart condition.
University officials released no other details on Johnson's condition or what problem kept him out of the lineup through the first 13 games.
Former Kentucky guard Ed Davender, the only Wildcat with at least 1,500 points and 400 assists, has died. He was 49.
Guard Naz Mitrou-Long, whose 2015-16 season ended in December due to hip problems, has been granted a hardship waiver for the coming season, Iowa State said.
As the Sooners look to life without superstar Buddy Hield and his sidekicks, it's clear their unseasoned players will need to grow up fast.