GAINESVILLE, Fla. (AP) -- Nick Calathes had 17 points and seven assists, Dan Werner added 15 points and Florida snapped a two-game losing streak with an 85-82 win over South Carolina on Wednesday night.
The Gators (20-7, 7-5 Southeastern Conference) won 20 games for the 10th consecutive year and may have moved a step closer to making the NCAA tournament.
Florida, which had lost four of its previous, is still in jeopardy of becoming the first national champion since Kansas in 1989 to miss the NCAA field.
South Carolina (12-13, 4-7) lost for the third time in four games.
The Gamecocks trimmed a 17-point deficit to 83-82 with 7.5 seconds to play, but Jai Lucas sank both free throws on the other end to help the Gators hold on.
Florida fouled Devan Downey with 2.2 seconds left, sending him to the line for a one-and-one. He was supposed to make the first one and intentionally miss the second, but he missed the first and Werner grabbed the rebound.
Marreese Speights had 10 points and 10 rebounds for the Gators.
Florida was up big in the second half. But the Gamecocks made it 75-72 with 3:15 remaining. Downey hit a 3, then Holmes dunked to end a fast break.
But Werner, who had missed 14 of 16 3-point attempts the last three games, hit arguably his biggest of the season.
Werner's shot made it 78-72 with 2:11 to play.
The Gators held on from there -- barely.
Calathes and Lucas each missed a free throw. On the other end, Downey made a driving layup and Baniulis hit a 3-pointer that made it 80-77 with 28.5 seconds remaining.
Calathes sank his next two, but Baniulis drained another 3 to make it 82-80 with 17 seconds left.
Calathes missed another one that allowed South Carolina to keep it close.
The Gators, who were 1-of-15 from 3-point range in a loss Saturday at Vanderbilt, were considerably better from behind the arc. They finished 11-of-23 from 3-point range.
Florida recognized retiring South Carolina coach Dave Odom before the game, calling him one of the classiest coached in the Southeastern Conference.
Odom acknowledged the announcement and ovation with a wave. His good mood didn't last very long, though.
The Gators used a 16-4 run early in the first half to open up a 19-9 lead. During the spurt, Odom punched an empty Gatorade cooler next to the bench, sending it flipping into the scorer's table.
Odom must have got his point across.
After trailing 26-15, the Gamecocks scored 10 unanswered points to get right back in the game. Holmes hit two jumpers, then Baniulis and Dwayne Day drained consecutive 3-pointers.
Florida responded, though.
Freshman Adam Allen hit three shots from behind the arc, Speights had a layup and a tomahawk dunk, and the Gators were back in front 46-33.
The Gators led 48-36 at halftime and quickly made it a 17-point game thanks to a flurry of 3s and another slam from Speights. Hodge, Werner and Calathes made shots from behind the arc.
Nike Men's Florida Gators Anthracite ELITE Stripe Performance Full-Zip HoodieShop
With a trio a top recruits from Philadelphia, the Penn State basketball program is primed to finally turn a corner.
Maryland point guard Melo Trimble, considered a lock to leave the program before struggling in the second half last season, has withdrawn from the NBA draft and will return for his junior season.
Louisville's Chinanu Onuaku, who recently underwent a medical procedure to correct a heart rhythm issue detected during the combine, will keep his name in the NBA draft pool.