COLUMBIA, S.C. -- Brenton Williams scored a career-high 38 points to lead South Carolina to a 79-72 win over Mississippi State on Wednesday night.
The Gamecocks (14-16, 4-13 Southeastern Conference) won for just the second time in 11 games to climb out of last place in the SEC.
South Carolina led 37-35 early in the second half before scoring 13 straight points to take a 50-35 lead.
The Gamecocks' advantage would climb to 22. Mississippi State (8-21, 3-14) got back in it by scoring 14 straight points to trail 68-63 with 2:37 left. But Williams then sank two free throws on the next possession and the Bulldogs wouldn't get closer.
Williams' 38 points were the most ever for South Carolina in an SEC game and the second-most in the league this year. Elston Turner scored 40 for Texas A&M against Kentucky in January.
Williams made 10 of his 17 field goals, including 6 of 9 3-pointers. He also made all 12 of his free throws, including four in the final minute.
Craig Sword led Mississippi State with 20 points. The Bulldogs have lost 13 of their last 14 games and will have to beat Auburn on Saturday for a chance to move out of last place in the SEC. Jalen Steele added 17, but left the game limping with just under five minutes to go.
South Carolina tried to pull away a couple of times in the first half. The Gamecocks led by six early on, but Mississippi State tied it within two minutes. South Carolina took a 23-16 lead with 8:51 left in the first half, but the Bulldogs took their first lead of the game less than for minutes later.
Mississippi State came in as the SEC's worst shooting team at 39.7 percent a game, but the Bulldogs shot 51.1 percent (24 of 47) against the Gamecocks, even after missing eight of their first 10 shots in the second half. But Mississippi State turned the ball over 20 times.
South Carolina made 28 of 35 free throws as the Gamecocks snapped a seven-game losing streak against the Bulldogs.
Wednesday's game matched up two teams that started the day in last place in the SEC. That wasn't much of a surprise. Both the Bulldogs and Gamecocks have first-year coaches handed massive rebuilding jobs. South Carolina finished last in the SEC last season and Mississippi State lost all of its starters. The Gamecocks were picked to finish 13th and the Bulldogs were picked to finish 14th in the league before the season started.
Both teams are locked into playing in the first round of the SEC tournament next Wednesday, needing to win five games to win the title and extend what have been woeful seasons.
Mississippi State will need to pick up two wins to avoid becoming the first SEC team with fewer than 10 victories since Georgia in 2004-05.
adidas Men's Mississippi State Bulldogs Maroon Long Sleeve Shooter ShirtPrice: $47.97 Shop
Michigan has hired assistant basketball coaches Billy Donlon and Saddi Washington.
Duke and Cincinnati, 2016 NCAA tournament teams, highlight the eight-team field for the Naismith Memorial Basketball Hall of Fame Tip-Off Tournament.
NCAA champion Villanova will play Notre Dame and Pittsburgh will play Penn State in the inaugural Never Forget Tribute Classic at Prudential Center on Dec. 10.