The Red Devils continued their fine form in Europe, while defeat for the Ukrainian side, coupled with a win for Bayer Leverkusen, saw it exit the tournament.
With Shakhtar needing to win as Bayer Leverkusen claimed three points against Real Sociedad, it took a Phil Jones strike midway through the second half to separate the two sides.
David Moyes' strong lineup showed he was eager to prevent his side from slipping to a third consecutive home defeat after suffering 1-0 losses to Newcastle and Everton domestically, as Wayne Rooney came back into the side, though Robin van Persie only made the bench.
Shakhtar coach Mircea Lucescu handed returns to Brazilian strike duo Fred and Taison, but it was United that started more brightly, as Jones forced goalkeeper Andriy Pyatov to block.
The visitors should have taken a 12th-minute lead when a defense-splitting ball from midfield set Teixeira away, but he dragged his shot wide. At the other end, Adnan Januzaj controlled expertly on his chest before spinning and firing goalward, forcing a fine save from Pyatov.
Shakhtar were the more dangerous side in the final third – Teixeira winding his way past several challenges midway through the half with a run that deserved better than his tame finish. However, Ashley Young wasted two chances to give United an advantage. First he outmuscled Darijo Srna, only to lob beyond the far post. Then he sliced another shot woefully wide.
Minutes after the break, Shakhtar again came close as Yaroslav Rakitskiy scuffed a shot against the outside of the post.
Finally, United burst into life as Rooney's audacious chip from distance almost caught Pyatov off his line. Reinforcements arrived in the shape of Van Persie and Tom Cleverley, and the Dutchman had not even touched the ball when Rooney's clever pass almost played him in.
But it was Jones who stepped up when United needed a hero. After United had pressed Shakhtar to win a 67th-minute corner, Van Persie's set piece from the right bounced through the box before Jones angled his body to drill beyond Pyatov.
Srna forced David de Gea into a smart save late on, but United held firm and Van Persie almost added late gloss to the score line when a clipped finish flashed wide. The Red Devils go through as group winners, while Shakhtar settles for the Europa League.