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
Running back Tae Provens commits to LSULSU landed its 2018 running back camp commit in 2018 Midison County (Ala.) running back commit Tae Provens on Saturday,
Tiger BlitzYesterday at 6:27 PM
LSU Football Elite Camp Day 3 RecapThat's a wrap for LSU's Elite Football Camp. There were plenty of notes out of Baton Rouge. Here's the latest from Saturday's day of camp.
Tiger BlitzYesterday at 2:40 PM
Finishing the 2018 Class, Here is My Top 5Oklahoma State is so far ahead of their usual time in collecting commitments in the football recruiting class and that will help greatly with the early signing period in December,…
GoPokesYesterday at 12:18 PM
WATCH: 2020 QB Max Johnson throw at LSU camp2020 Oconee County (Ga.) quarterback Max Johnson was in to camp at LSU on Saturday, impressing the Tigers' staff. Watch his clips above from camp.
Tiger BlitzYesterday at 11:36 AM