(TSX / STATS) -- GREENVILLE, S.C. -- South Carolina showed a full array of toughness at an ideal time.

The Gamecocks collected a gigantic prize as a result.

Sindarius Thornwell scored 24 points and seventh-seeded South Carolina used sudden hot shooting in the second half to knock second-seeded Duke out of the NCAA Tournament, winning 88-81 Sunday night in a charged-up atmosphere for the second-round game at Bon Secours Wellness Arena.

"Unbelievably proud of our guys," South Carolina coach Frank Martin said. "To be able to play against a team like Duke and play so well."

The Gamecocks took advantage of energy provided by a partisan home-state crowd in the biggest victory for South Carolina in at least a generation. The players stayed in the arena to celebrate with their fans afterward.

"They had it rocking. We had the atmosphere," sophomore guard P.J. Dozier said. "You could feel it."

Duke was the preseason No. 1 team and seemed to have gained traction by winning four games in four days to capture the ACC tournament title. The Blue Devils rallied from second-half holes in the final three games in that tournament.

South Carolina goes on to meet third-seeded Baylor in the East Region semifinals Friday night at New York's Madison Square Garden.

Chris Silva and Duane Notice pumped in 17 apiece and Rakym Felder provided 15 points for South Carolina (24-10). Dozier scored 11 points before fouling out following a turnover with 3:25 to play.

"We never had any doubt in our team," Dozier said. "We have the utmost faith in our team and our coaching staff that we can go out and beat anybody."

The Gamecocks scored 65 second-half points on 71.4 percent shooting.

"They've become mentally tough, as mentally as can be," Martin said of his team.

The Gamecocks, who shot woefully in the first half, made 12 of their first 16 attempts from the field in the second half.

"I have no idea," Duke guard Matt Jones said of South Carolina's efficiency. "They made more plays."

They led 60-53 with less than nine minutes to play, resulting in Duke's second timeout of the half. The margin grew to 68-58 at the five-minute mark.

Jones, a senior guard, fouled out at the 2:58 mark after scoring six points.

"It was actually the most physical game we've played in all year," Duke coach Mike Krzyzewski said. "We got wore down. ... We got in a lot of foul trouble."

Kennard, the team scoring leader, picked up his third foul with 17:22 left and his fourth at the 12:03 mark.

Duke led 30-23 at the half, in part because South Carolina shot 20.6 percent from the field. The Gamecocks made 7 of 35 shots, with twice as many attempts as Duke (17).

"We came in the locker room at the half a little shocked, but Coach said we were in good shape only being down seven points," Felder said.

Allen delivered seven points and two assists in helping Duke to an 18-14 lead.

South Carolina went more than six minutes without scoring, while Duke built a 24-14 edge during that time.

Duke had 10 turnovers and 10 fouls barely 16 minutes into the game.

NOTES: Duke and South Carolina met for only the second time in 46 seasons. ... Duke coach Mike Krzyzewski failed in his bid to take a team to the Sweet 16 for a record 24th time. ... South Carolina had never advanced to the Sweet 16 under the tournament's current format. When the Gamecocks defeated Marquette on Friday night, it was their first NCAA Tournament victory since 1973. ... South Carolina overcame a 10-point deficit to defeat Marquette in the first round for its biggest comeback to result in a victory this season.