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
Updated Scout 300 Trend Meter For 2017The 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.
SEC football grad rates, first to worstSee the newly released Graduation Success Rates for every SEC football program.
Week 12 CFB Rushing LeadersCheck out who put up big rushing numbers week 12 in college football.
Week 11 College Football PredictionsWeek 11 college football predictions for the 10 biggest games. The Pac-12 takes center stage for the first time all year, as red-hot USC travels to Seattle to take on unbeaten…
Chad Terrell Commits to South CarolinaThe No. 5 wide receiver in Georgia is going to take his game to the SEC. Chad Terrell has committed to South Carolina and he talks about that here...