David Noel had 19 points and 12 rebounds; Tyler Hansborough, who committed eight turnovers, added 15 points, eight rebounds and three assists; and Danny Green scored 10 points for the Tar Heels (13-5, 4-3 ACC), who have won three of their last four games.
Nik Caner-Medley had a team-high 15 points and five rebounds; D.J. Strawberry added 14 points, five rebounds and two assists; and James Gist had 11 points and nine rebounds for the Terrapins (14-6, 4-3 ACC), who have dropped two in a row.
Maryland Coach Gary Williams again was thwarted in a quest for his 349th win with the program to overtake Lefty Driesell as the school's all-time winningest coach.
The Tar Heels, who trailed by two points at the half, out-scored Maryland, 39-22, in the second half.