North Carolina State started losing its key players to fouls. Not long after that, the Wolfpack lost their huge lead — and the game, too.

N.C. State let a late 20-point lead slip away against No. 5 Duke on Thursday night in a 78-73 loss that marked its 14th straight defeat at Cameron Indoor Stadium.

This one got away largely because the Wolfpack (18-8, 7-4 Atlantic Coast Conference) were forced to play important stretches with some important players stuck on the bench in foul trouble.

Guard C.J. Williams barely got in the flow, managing just three points — he averages 11 — while playing just 12 minutes before fouling out. Two key members of N.C. State's front line — Richard Howell and C.J. Leslie — sat during parts of Duke's rally with four fouls. Both fouled out in the final 2 minutes.

"It made it difficult, and we lost our aggressiveness when we got so many guys in foul trouble," first-year coach Mark Gottfried said. "That hurt. We've got to do a better job of defending without fouling."

Seth Curry scored 21 of his season-high 26 points in the second half, Austin Rivers added 16 points on 4-of-13 shooting and the Blue Devils (22-4, 9-2) erased that 20-point deficit with 11½ minutes left. They trailed by 16 points at halftime — the largest deficit they have ever overcome to win under Hall of Fame coach Mike Krzyzewski.

"They thoroughly outplayed us for about 29 minutes," he said. "And then we thoroughly outplayed them for 11."

It came nine days after they rallied from 10 points down in the final 2½ minutes to upset North Carolina.

"I'm tired of doing this, to tell you the truth," Rivers said. "This is a great win, but we're exhausted, man. This is a weird win for us. I'm so proud and everybody's so proud, but at the same time, we need to stop doing this.

"To be down in 20 in Cameron should never happen," he said.

They did it with late rallies of 13-0 and 20-3 to erase that huge deficit and keep pace atop the league standings with No. 20 Florida State and No. 8 North Carolina.

Lorenzo Brown scored 19 points to lead the Wolfpack (18-8, 7-4), who trailed 76-73 with the ball in the final seconds with a chance to force overtime.

But Brown missed a contested 3-pointer from the corner with about 7 seconds left, and Curry hit two free throws with 2.2 seconds to go to seal it.

"We're a good team. We've got to find a way to become a little bit better," Gottfried said.

Alex Johnson scored a season-high 13 points, Leslie added 12 and Scott Wood had 10 for N.C. State, which led 61-41 on Brown's free throw with 11:33 left.

Then, the Blue Devils finally showed some life.

They started coming back by reeling off 11 straight points, with Curry hitting three free throws and Andre Dawkins knocking down a 3-pointer before Curry's jumper with 8:44 left made it 61-52 — the first time Duke was within single digits since midway through the first half.

After DeShawn Painter put N.C. State up 68-56 with 6:10 left, the Blue Devils came up with their final surge.

Rivers started it with a 3-pointer and scored nine points during the burst. His deep 3-pointer with 2½ minutes left gave Duke its first lead, 72-71.

"It was just kind of the same thing I did versus Carolina," Rivers said of his buzzer-beating 3 that beat the Tar Heels.

Mason Plumlee added 10 rebounds for the Blue Devils, who denied the Wolfpack their first victory at Cameron since 1995 — when Krzyzewski was out following back surgery. N.C. State hasn't beaten a Krzyzewski-coached team in Durham since 1988.

And things don't get much easier for the Wolfpack, who play host to the Seminoles on Saturday and the Tar Heels next Tuesday.

"You put in a whole week of work preparing for these guys and go up 16 at halftime and give it up, it's tough to swallow," Johnson said. "But Coach said it in the huddle. We've just got to let this one go and get ready for Saturday."