The Gamecocks trailed 3-1 before they scored six runs, four unearned, with two outs in the sixth.
South Carolina had the bases loaded with two outs when Nick Gardiner singled to right off Lane Mestepey (7-4). Landon Powell scored easily, but Melillo collided with LSU catcher Matt Liuzza after the ball bounced under Liuzza's glove.
Umpire Bob Homolka called Melillo safe, but immediately ejected him for not trying to avoid the collision.
South Carolina coach Ray Tanner came out of the dugout to protest, and after the umpiring crew consulted with supervisor Dave Yeast, Homolka's decision was reversed and Melillo was reinstated.
Jim Paronto, secretary-editor to the NCAA Baseball Rules Committee, said in a statement that Homolka initially believed the collision was caused by a flagrant act by Melillo but it was later determined that it was not.
It was the second CWS game in which the collision rule came into play. Georgia shortstop Justin Holmes was ejected for running into catcher Nick Hundley in the Bulldogs' 8-7 win. Holmes was out on the play.
The Gamecocks went on to score four more runs in the inning, three on throwing errors by the Tigers. South Carolina added six more runs in the eighth inning to seal the victory.
South Carolina (51-16) will face the loser of Monday's winner's bracket game between Cal State Fullerton and Miami on Tuesday.
LSU (46-19) was knocked out of the CWS in two games for the second year in a row by South Carolina.
LSU, which had won two of three regular-season meetings between the teams, was dealt its worst loss since being beaten 15-4 by Mississippi State in 2002. It was the Tigers' worst loss in the CWS since Cal State Fullerton beat them 20-6 in 1994.
The teams combined for a CWS-record 34 singles. South Carolina's Steven Tolleson had the game's only extra-base hit, a double in the ninth.
Steve Pearce had four singles for the Gamecocks, and LSU's Will Harris had three.
Gamecocks starter Aaron Rawl (13-4) got the win after scattering 11 hits over 6 2-3 innings.
SC Takes Strange Game Over LSU
Gamecock Anthem Top Stories
Draft day: Cardinals on the clockThe Arizona Cardinals are looking for their quarterback of the future, but will the team trust its draft board or work to secure a signal-caller early?
CardinalsSourceYesterday at 10:13 AM
New 2018 Target Emerging for UGA:Dawg Post breaks down new Georgia targets in the 2018 class.
Dawg PostYesterday at 7:12 AM
Morning Manny: Defensive Backs ReviewManny Benton reviews the Redskins DB positions prior to the NFL Draft.
Breaking BurgundyYesterday at 6:37 AM
Bank Blog: OSU's 2018 Recruiting Class LookOhio State has added five highly rated players to the 2018 recruiting class in April, and now sit at the number-five spot in the latest class rankings. Let's look at each commit,…
Buckeye SportsYesterday at 5:46 AM
Brown garners elite attentionFive-star prospect Christian Brown was one of the top performers at the adidas Gauntlet, and elite schools continue to make him a priority recruit.
Scout HoopsWednesday at 11:32 AM