Julien Lewis added 16 points for the Longhorns (7-4).
Reggie Bullock led the Tar Heels (8-3) with 18 points and 13 rebounds.
North Carolina cut the deficit to four points in the second half before Texas sealed the victory.
James McAdoo had 14 points and joined Bullock as the only Tar Heels in double figures. North Carolina shot a season-low 31.3 percent from the field and turned the ball over 18 times.
Texas attempted 46 shots in the first half. North Carolina had only 30.
"It was an ugly night for us to say the least," North Carolina coach Roy Williams said.
Jonathan Holmes scored 15 points and Ioannis Papapetrou added 10 points and 10 rebounds for the Longhorns.
North Carolina made just 3 of 19 3-point attempts. P.J. Hairston, the Tar Heels' third-leading scorer, shot just 2 of 12 from the field.