The Cavaliers (17-6, 7-3) never trailed after halftime in their fourth straight win over the Terrapins (17-7, 5-6). Virginia improved to 3-4 on the road, 2/3 in the ACC.
The victory gave the Cavaliers a one-game lead over idle North Carolina and got them within a half-game of Duke, which faced Boston College on Sunday night.
Despite committing 16 turnovers, the Cavaliers shot 58 percent from beyond the arc (11 for 19) and finished with a 34-29 rebounding advantage. Virginia has won three in a row at Maryland for the first time since 1991-93.
The Cavaliers limited Maryland to one basket in the opening four minutes of the second half and extended a six-point halftime lead to 44-32. After Seth Allen scored for the Terrapins, Paul Jesperson bagged a 3-pointer on the other end to make it 47-34.
It was 51-37 with 13 minutes left before Maryland coach Mark Turgeon called a timeout, took out Len and instructed his team to employ a full-court press. The Cavaliers struggled under the pressure, and the Terrapins scored five straight points to cut the gap to 51-42.
But Virginia answered with a basket by Harris and two 3-pointers by Evan Nolte for a 59-46 advantage.
Maryland closed to 63-55 with 6:48 remaining and 74-67 in the final minute, but the Cavaliers had an answer on each occasion.
Anderson was jeered by Maryland students virtually every time he touched the ball. The 6-foot-6 freshman committed to Maryland in 2011, but after Terps coach Gary Williams retired Anderson changed his mind and accepted a scholarship from Virginia.
Anderson went 5 for 14 from the floor but was 6 for 6 at the line and grabbed nine rebounds.
Anderson scored 14 points and Harris had 12 to stake the Cavaliers to a 35-29 halftime lead. Virginia limited the Terrapins to 11-for-31 shooting and held a 20-14 rebounding edge.
Maryland missed eight of its first 11 shots from the floor and trailed 16-9 after the Cavaliers got successive 3-pointers from Harris. It was 20-11 before a layup by Allen and a dunk by Nick Faust sparked a 13-5 run that got the Terrapins to 25-24.
Minutes later, a follow-shot by Charles Mitchell and a driving layup by Faust tied it at 28.
Anderson responded with a jumper, and the Cavaliers never surrendered the lead.