CHARLOTTESVILLE — The ­Virginia men's basketball team delivered a defensive gem for the majority of its game Monday night against North Carolina State, holding the ACC's second-highest-scoring offense more than 24 points below its season average and shutting the ­Wolfpack out entirely for a stretch of more than 10 minutes in the second half.

But the Cavaliers’ typically stifling defense betrayed them in the final minutes, when they were unable to string together stops and allowed a slim lead to slip away in a 53-51 loss at John Paul Jones Arena.

“They made a couple plays,” Cavaliers Coach Tony Bennett said of the Wolfpack. “That’s what you have to do down the stretch to win. When it gets to that time, someone has to jump up and make some big plays and score a bucket or two, and they did that.”

After Virginia made a rousing comeback from a double-digit deficit to claim a 47-45 lead with 3:13 to play, the Cavaliers (12-6, 4-4 ACC) yielded three consecutive field goals and never recovered as their eight-game winning streak against the Wolfpack (14-5, 5-3) ended. Virginia has lost four of its past five games overall.

Markell Johnson’s three-pointer with 2:44 left put North Carolina State ahead 48-47, and the Wolfpack never trailed again. The margin expanded to 52-47 on C.J. Bryce’s jumper with 26 seconds to go, and the closest the Cavaliers came after that was 52-51 with 8.2 seconds left before Devon Daniels made 1 of 2 free throws to cap the scoring.

Virginia freshman guard Casey Morsell, an All-Met from St. John’s College High, missed a long jumper at the buzzer, sealing the Cavaliers’ third home loss this season. They lost just once at John Paul Jones Arena each of the previous two seasons.

“I realized that time was running down, so I couldn’t look pass because there wasn’t that much time to really make a play,” ­Morsell said. “I kind of tried to get downhill, but it seemed like they built a fence, which forced me to go to the opposite wing, and time was ticking, so I had to let it go.”

Sophomore point guard Kihei Clark led the Cavaliers with 10 points and five assists while adding seven rebounds, but he also had three turnovers. No other Virginia player scored more than eight points on a night when the Cavaliers shot 36 percent from the field and went 3 for 12 from three-point range.

The Wolfpack’s lead peaked at 42-31 early in the second half following an 11-2 burst that featured three-pointers from Daniels and Bryce and a three-point play from Daniels. The 11-point deficit left Virginia in an unenviable position, especially given its offensive woes this season.

But the reigning national champions clawed back with a 15-0 run over 10:13. That stretch, which included six points from rugged reserve forward Francisco Caffaro, produced a 46-42 lead with 4:37 remaining.

But the Cavaliers made just one field goal the rest of the way, and they remain the only team in Division I that hasn’t reached 65 points this season.

D.J. Funderburk, a junior forward, scored a game-high 14 points on 6-for-8 shooting for the Wolfpack, which won for the first time at John Paul Jones Arena, which opened in 2006.

Bryce added 13 points in North Carolina State’s third straight victory overall and fourth in five games.

“This is a tough place to play, and then Virginia is a tough program to play against because they’re so great on the defensive end,” Wolfpack Coach Kevin ­Keatts said. “I told the guys before the game, ‘If we’re going to win the game, it’s going to be because we have to defend them,’ because I knew the score would be low.”

North Carolina State thrived even without starting forward Manny Bates, the ACC’s leader in blocks (2.9 per game). The redshirt freshman sat out his first game while in concussion protocol after playing six minutes in a 60-54 win Saturday against Clemson.

With the Wolfpack’s 6-foot-11 rim protector out of the picture, Virginia managed 16 points in the paint in the first half but still trailed 28-26 at halftime. The Cavaliers faded thereafter, with missed layups and careless ball security on entry passes putting them in a hole that ultimately doomed them even after they rallied.

“It’s a tremendous opportunity to lead, coach, teach,” Bennett said of the Cavaliers’ current rough patch. “I think we’re improving in little ways, but it’s not showing in the win-loss column.”

Read more on college sports: