COLUMBIA, S.C. (AP) South Carolina coach Frank Martin wondered where the team he'd coached to several big victories had gone in the first week of Southeastern Conference play. That group was back against Alabama.
The Gamecocks (10-5, 1-2 SEC) saw most of a 13-point, second-half lead disappear, yet hung on to defeat the Crimson Tide 68-66 on Tuesday night.
''That energy, that enthusiasm we were playing with came back,'' Martin said.
Alabama (12-4, 2-1) had a shot to tie or win at the end, but Levi Randolph's 3-point try hit off the rim as time ran out and ended the Crimson Tide's six-game winning streak.
South Carolina seemed poised to be one of the SEC's rising teams, notching wins over Oklahoma State, Clemson and then-No. 9 Iowa State in pre-conference play. But the Gamecocks were listless and mistake prone in losses to Florida and Ole Miss last week.
But Martin said the team's verve appeared in practice this week, giving him hope a better showing was ahead. And South Carolina delivered, overcoming Alabama's 9-0 start to the game and its second-half rally.
''Real proud of our guys,'' Martin said. ''They fought and fought and fought and fought.''
All the way to the end.
Shannon Hale hit two foul shots to draw Alabama within a basket with 45.8 seconds left, then blocked Sindarius Thornwell's driving attempt to set up a final shot.
Martin used a quicker, smaller lineup to keep the ball in front of them and prevent an easy drive. Marcus Stroman held his ground on the outside and forced Randolph's long attempt.
''Did everything go the way I wanted? No, I wanted that final shot to go in,'' Alabama coach Anthony Grant said.
Tyrone Johnson led South Carolina with 13 points and Michael Carrera had 12 points and eight rebounds.
Ricky Tarrant led Alabama with 15 points before fouling out with 4:42 remaining.
The Gamecocks avoided starting SEC play 0-3 for a second straight season. They won despite missing their last eight shots.
Alabama came in looking for its first 3-0 start in the SEC since coach Wimp Sanderson and star Derrick McKey led the Crimson Tide to 28 wins and a trip to the NCAA tournament's Sweet 16.
Things went the Crimson Tide's way early on as they rolled out to a 9-0 lead less than five minutes in. That's when South Carolina turned up its defense in a 28-10 rally over the next 14 minutes to lead 28-19 with 1:27 left in the half.
Alabama outscored the Gamecocks 6-2 over the final 90 seconds to head to the locker room down 30-25. The Crimson Tide had the chance to cut into the lead further after Mindaugas Kacinas was called for a flagrant foul, his arm catching Riley Norris under the chin with 40 seconds left.
However, Norris missed two foul shots and Tarrant was 1 of 2 from the line on Alabama's ensuing possession due to Kacinas' foul.
South Carolina started quickly after the break, Duane Notice scoring eight points in a 20-12 run to take a 50-37 lead before Alabama rallied to tighten the game.
Alabama: Crimson Tide coach Anthony Grant was a high-school basketball teammate of South Carolina coach Frank Martin at Miami Senior High. The two have remained close friends.
South Carolina: This game marks a stretch of later night basketball for the Gamecocks. They play at 8:30 p.m. (EST) at Auburn on Saturday before returning home for another 9 p.m. start against Tennessee.
South Carolina missed its last eight shots over the final 6:30. The Gamecocks got only six foul shots the rest of the way. Thornwell, the team's leading scorer for much of the year, was 1 of 8 from the field for just six points.
WHISTLE WHILE YOU WORK
There was plenty of whistling in this one. The teams combined for 54 fouls, 27 on each team. South Carolina's Mindaugas Kacinas received a flagrant foul, while the Tides' Michael Kessens and the Gamecocks' Laimonas Chatkevicius received matching technical.
Alabama returns home to face No. 1 Kentucky on Saturday.
South Carolina plays at Auburn on Saturday night.