The Bulldogs (11-8, 2-4) led much of the game with first place in the SEC West on the line, but faltered at the end of each half in the loss to the Gamecocks (12-8, 2-4).
Brandon Wallace scored 10 points for South Carolina and tied a career-high with 16 rebounds. Jamont Gordon led Mississippi State with 16, but disappeared in the second half as Kelly asserted himself. A double-teamed Gordon missed a 3-pointer as time expired.
Mississippi State has lost six of its last eight, but remains in the jumbled SEC West chase.
The Bulldogs led by as much as 12 in the first half and seven in the second half, but went cold over the final 18 minutes.
Wallace led the Gamecocks back from a seven-point deficit in the middle of the second half with five points in an 11-2 run that gave South Carolina its first lead since the opening minutes. His emphatic dunk in transition ended the run and gave his team a 55-53 advantage with 9:18 left.
South Carolina outscored Mississippi State 11-8 from there. Kelly scored six of those points to put the game away.
Mississippi State built a 12-point lead with a 14-3 run early in the first half that included five points from Ben Hansbrough, who scored 11. But South Carolina got back in the game by holding the Bulldogs scoreless over the final 3:55 of the half and trailed 36-35 at halftime.
South Carolina, which never led by more than four, got 15 points from Dwayne Day and Charles Rhodes added 10 for Mississippi State.
Kelley leads USC to road win over Miss State
Gamecock Anthem Top Stories
Scout 2018: Top 30 for 2018Scout releases its updated Top 30 for the Class of 2018, which is now on the clock leading up to National Signing Day 2018...
Updated Scout 300 Trend Meter For 2017Signing day is Feb. 1 and the updated Scout 300 Trend Meter for the 2017 class takes a look at which schools are trending for each uncommitted member in the Scout 300.
Top 100 high school football prospectsOf the 270,000 high school seniors that played football in 2016, only these players made Scout.com's Top 100 list.
Scout's Top 25 Recruiting ClassesA look at Scout's top 25 classes with just over a week to go to Signing Day.
South: Five on Flip WatchSome of the top 2017 prospects in the South that have their names on a commitment list already may not end up on same that one February 1. Find out five to watch here...