Florida's post-season spot is assured, so the Gators looked at Saturday's game at Vanderbilt as a chance to solidify their hold on first place in the SEC's Eastern Division.
The Commodores, however, were desperate. They hadn't defeated a Top 25 team this season and were below .500 in Southeastern Conference play.
So with its post-season hopes fading fast, Vanderbilt knew it needed a victory over the 16th-ranked Gators.
The Commodores got it, downing Florida 82-78 for their first victory over a ranked team in six tries.
"We showed a lot of character," Vanderbilt coach Jan van Breda Kolff said.
"This win showed a lot of what this team is made of, and we showed a lot of guts."
Billy McCaffrey scored 31 points, including two free throws with nine seconds left that clinched the victory for the Commodores (14-10, 7-7 SEC) before 15,010 fans.
Ronnie McMahan, coming off the bench instead of starting due to a sprained ankle, had 21 points and four steals for Vanderbilt.
"This is a big victory, another big win in the SEC," the junior guard said.
"This gets everybody's feet together after the loss at Mississippi. Now we have to get together and try to win two more going into the SEC Tournament."
Florida outrebounded Vanderbilt 36-29, but was outshot from the field and the foul line.
"It was a hard-fought game, and obviously a tough one to lose," Gators coach Lon Kruger said. "The players are obviously disappointed, but there's a lot of basketball left."
Florida (22-5, 11-3) travels to seventh-ranked Kentucky on Wednesday to battle for first in the Eastern Division. Kentucky, 10-3 in league play, faces Georgia today as it attempts to tie the Gators for the top spot.
"Going from Nashville to Lexington is not going to be easy, but I think we'll step up to the challenge," Kruger said. The Gators defeated Kentucky 59-57 in Gainesville earlier this season.
The Gators, who led 39-35 at halftime, fell behind early in the second half before staging a closing rally, pulling within 79-78.
Frank Seckar, who had missed his two previous free throws, made one with 11.7 seconds left to put Vanderbilt ahead 80-78. He missed his second attempt, but Vanderbilt got the rebound and McCaffrey was fouled.
The senior guard and former Duke Blue Devil made both free throws, completing a 7-of-7 day at the line.
Dan Cross scored 21 points for Florida, while Craig Brown added 20 and Dametri Hill 15.
Vanderbilt trailed 39-35 at halftime, but used a 14-6 run to go ahead 49-45 early in the second half. Cross' basket gave Florida its last lead, 52-51, with 15:56 left before Vanderbilt took control with a 10-3 run and held off the Gators down the stretch.
The Commodores took their biggest lead, 24-17, on two free throws by Malik Evans with 7:28 left in the first half. Florida closed out the half with a 10-0 run to take a 39-35 advantage.