Updated

North Carolina scored three times in the bottom of the sixth inning to rally for a 5-4 victory over South Carolina in the third and deciding game of the Chapel Hill Super Regional on Thursday.

North Carolina, the No. 1 overall seed in this year's NCAA field, advanced to the College World Series for the first time since 2011, though the Tar Heels were taken to the limit by a gritty and proven South Carolina squad that claimed national championships in 2010 and 2011 and reached last year's CWS final.

The Tar Heels trailed 4-2 entering the bottom of the sixth when Landon Lassiter led off with a single against Adam Westmoreland (7-4) and Colin Moran followed with a triple down the right-field line to cut UNC's deficit. Moran later scored the tying run when Gamecocks first baseman Kyle Martin committed a throwing error after taking a relay throw on Cody Stubbs flyout to center.

North Carolina eventually loaded the bases on a hit batsman and a pair of walks before the Gamecocks' Tyler Webb walked Parks Jordan to force in the go- ahead run.

Trent Thornton, Chris McCue and Kent Emanuel then held South Carolina scoreless over the final three innings to secure the Tar Heels' trip to Omaha. UNC will take on in-state rival North Carolina State Sunday at 3 p.m. (ET) in its CWS opener.

Thornton (11-1) was credited with the win after working 4 2/3 innings in relief of starter Benton Moss. The freshman allowed three runs, though only one was earned due to a pair of Tar Heel errors that allowed South Carolina to grab a 3-2 lead by scoring twice in the top of the fifth.

Stubbs threw errantly after fielding a bunt at first base from Tanner English that put two on with none out in the fifth, with both runners later crossing the plate on a dropped fly ball by North Carolina center fielder Chaz Frank.

South Carolina extended the margin to 4-2 in the top of the sixth on English's two-out double that brought home Grayson Greiner.

Game 3 had been initially scheduled to be held Monday, but was postponed by heavy rain.

Oregon State, LSU, Mississippi State, Indiana, Louisville and UCLA had already punched their ticket to the CWS along with NC State by winning their respective Super Regionals.

The 2013 College World Series will begin Saturday at TD Ameritrade Park in Omaha. Oregon State, the No. 3 national seed, will face Mississippi State in the opener at 3 p.m. (ET), with Indiana and Louisville to square off afterward.

LSU, seeded fourth nationally, will take on UCLA on Sunday following the conclusion of the North Carolina-NC State matchup.