CHARLOTTESVILLE — One game after a particularly humbling loss, the No. 5 Virginia men’s basketball team made the necessary corrections, particularly in the second half, to pull away from No. 7 North Carolina, 56-47, on Sunday afternoon.

The triumph at John Paul Jones Arena followed Wednesday’s 69-40 dismantling at Purdue in the ACC/Big Ten Challenge, which left the Cavaliers with plenty to address ahead of this early ACC showdown.

Turnovers were among the most troubling maladies. Virginia (8-1, 2-0) committed 16, matching its most this season, against the Boilermakers and then had nine in the first half against the Tar Heels (6-3, 1-1) before going more than 15 minutes during the second half without one. That attention to ball security helped the Cavaliers play at their pace, flustering North Carolina to the point where it fouled Virginia shooters on three consecutive possessions.

The Cavaliers made the most of their trips to the free throw line, converting 18 of 25 attempts — including Mamadi Diakite sinking all five of his on the way to a team-high 12 points. He also had six turnovers and fouled out in the final moments, but by then the outcome was no longer in doubt.

“We needed it all,” Virginia Coach Tony Bennett said. “We’re far from perfect. Carolina and us are both trying to keep finding our way, but we just have to fight, and I was thankful that those guys came to the party and responded from a thorough can of you-know-what at Purdue.”

The Tar Heels went 1 for 14 from three-point range for their lowest percentage of the season and finished 12 for 22 at the foul line. They also shot 37.0 percent and committed 12 turnovers that led to 14 points for Virginia, which has won five of six in the series.

North Carolina freshman point guard Cole Anthony turned in a second straight underwhelming performance, shooting 4 for 15 with six turnovers and no assists. The projected NBA draft lottery pick also went 4 for 15 in Wednesday’s 74-49 loss to visiting Ohio State.

This is the first time since 1947 that North Carolina has failed to score 50 points in consecutive games.

“This is the most frustrated I’ve ever been,” Coach Roy Williams said.

North Carolina received a bit of lift when Armando Bacot was able to play despite a sore ankle. The freshman forward landed on a player’s foot during a scrum for an offensive rebound against the Buckeyes, and two teammates helped him off the court. Williams had all but ruled out Bacot for Sunday’s game, saying North Carolina’s leading rebounder (8.9) had a 0.00001 chance of playing.

X-rays were negative for a break, but Williams indicated Bacot’s ankle swelled considerably the next day. By Sunday’s warmups, though, Bacot told the training staff that he felt good enough to try to play. He finished with 11 points on 5-for-8 shooting for the sputtering Tar Heels.

The Cavaliers have been laboring offensively, too, failing to reach 50 points in their previous three games until Sunday’s relative outburst included making 6 of 17 (35 percent) attempts from three-point range. Virginia entered last in the ACC in three-point percentage (23.9).

Tomas Woldetensae, a junior guard from Italy, made 3 of 4 from beyond the arc for 11 points and added two steals. Francisco Caffaro, a redshirt freshman from Argentina, chipped in 10 points and seven rebounds, providing a rugged interior presence that Virginia has been looking for after the graduation of center Jack Salt.

“That’s just the way I always play,” said Caffaro, who started playing the game seriously only a handful of years ago.

Woldetensae, Caffaro and Justin McKoy (four points, five rebounds) had strong contributions for Virginia’s reserves, who outscored their counterparts 25-10 and helped compensate for the absence of starting guard Braxton Key.

The 6-foot-8 senior played important minutes during Virginia’s run to the national championship last season but missed his third consecutive game after surgery on his left wrist. He remains out indefinitely, but Bennett indicated Key has had stitches removed and is allowed to sweat around his wrist, moving him a step closer to returning to the lineup.

“I hope soon we will get Braxton back,” Bennett said, “but what this is doing, whether we are successful or not, is it’s providing some depth that maybe we wouldn’t have found otherwise — so that’s the bright side of it.”