The Cavaliers (21-2, 9-2 Atlantic Coast Conference) closed the second half on a 21-6 run to seal it, beating the Tar Heels for a fourth consecutive time.
Trailing by seven at the half, North Carolina went on a 17-3 run and built a 7-point lead. But the experienced Cavaliers would not go away and the 3-pointers stopped falling for Carolina and starting going in for the Cavs.
Virginia sharpshooter Kyle Guy took over late, including with a dagger of a 4-point play down the stretch. He finished with 20 points as did De'Andre Hunter.
The Heels (19-5, 9-2) were led by freshman guard Coby White, who had 17.
Freshman Nassir Little suffered a right ankle injury with 12:06 left in the first half. The birthday boy didn't return.
UNC shot just 35 percent for the game.
The Cavaliers were coming off a second loss this season to No. 2 Duke and arrived in Chapel Hill facing the prospect of their first losing streak of any kind in two years. Yet Guy and his teammates rallied from seven down in the final eight minutes to snap UNC's seven-game winning streak.
The Tar Heels visit Wake Forest on Saturday, while Virginia hosts Notre Dame on Saturday.
The Associated Press contributed to this report.