Mark Lyons made a driving layup with 7.1 seconds left to lift the eighth-ranked Arizona Wildcats over the fifth-ranked Florida Gators, 65-64.
Arizona scored the final seven points of the game to improve to 8-0 on the season.
Solomon Hill had 18 points to pace the Wildcats, who went 18-of-21 from the foul line. Nick Johnson and Lyons added 15 and 14 points, respectively.
Mike Rosario ended with 16 points for the Gators (7-1), who went 10-of-18 from beyond the arc. Erik Murphy donated 15 points and seven rebounds.
Scottie Wilbekin's 3-pointer with 2:35 to play gave Florida a 64-58 lead. However, it proved to be the last points of the game for the Gators.
Arizona was 15-of-15 from the foul line until Johnson missed a pair of foul shots at the other end.
After each team missed a pair of 3-pointers, Rosario turned the ball over. Kevin Parrom made two foul shots to get Arizona within four, 64-60, with 56.8 seconds left.
That was just the start of Florida's meltdown. The Gators were unable to get the ball in on the ensuing inbound pass and had to call a timeout. The extra time to draw up a play failed to work, as Rosario turned the ball over on the inbound pass.
Hill made Florida pay for its mistake by making a layup with 45.6 ticks remaining. The Gators turned the ball over again, with Johnson stealing the ball from Kenny Boynton. Grant Jerrett made 1-of-2 from the charity stripe to make it a 64-63 contest with 26.1 seconds to go.
Boynton had a chance to redeem himself after being fouled by Brandon Ashley. He failed to do so, missing the front end of a one-and-one. Johnson grabbed a key defensive rebound for Arizona.
Lyons made a contested layup to give the Wildcats a 65-64 lead with 7.1 seconds to play. Arizona prevented Florida from getting a final shot off.
"I almost feel guilty beating Florida from this perspective. Throughout the game, they outplayed us," Arizona coach Sean Miller said. "Mark Lyons' shot was one of the biggest shots I've seen. There was no doubt in my mind that it was going in."
Florida led for most of the first half and took a 30-19 lead on Murphy's 3- pointer with 3:59 left.
Arizona was able to keep it close by scoring the final eight points of the half. Hill's steal and dunk cut the gap to 32-29 at the break.
The Gators went ahead by 11, 54-43, on Rosario's 3-pointer with 10 minutes remaining in the second half.
However, Arizona responded with a 7-0 spurt to make it a four-point contest.
Florida and Arizona have split four all-time meetings. The Gators had won the last two matchups, including a 78-72 overtime thriller last season in Gainesville ... Florida went 6-of-8 from the foul line.