Jose Mourinho's side were drawn from pot two to face the Serie A champions, who signed former Red Devils and Real Madrid star Ronaldo this summer. The Italian and English giants will compete with third seed Valencia and then Swiss side Young Boys.
Meanwhile, Premier League champions Manchester City are in Group F with Shakhtar, Lyon and Hoffenheim.
Last year's finalists Liverpool will take on Paris Saint-Germain, Napoli and Crvena Zvezda in Group C, while reigning European champions Real Madrid were put into Group G, followed by Roma, CSKA Moscow and Viktoria Plzen.
Group B looks to be one particularly tough group as Barcelona, Tottenham, PSV and Inter are all together.
n Group A, Europa League winners Atletico Madrid will take on Borussia Dortmund, Monaco and Club Brugge. Lokomotiv Moscow were the first seed for Group D and will take on Porto, Schalke and Galatasaray.
Bundesliga winners Bayern are with Benfica, Ajax and AEK Athens in Group E.
Complete Champions League 2018-19 Group Stage
Group A: Atletico Madrid, Borussia Dortmund, Monaco, Club Brugge
Group B: Barcelona, Tottenham, PSV, Inter
Group C: PSG, Napoli, Liverpool, Red Star Belgrade
Group D: Lokomotiv Moscow, Porto, Schalke, Galatasaray
Group E: Bayern Munich, Benfica, Ajax, AEK Athens
Group F: Manchester City, Shakhtar Donetsk, Lyon, Hoffenheim
Group G: Real Madrid, Roma, CSKA Moscow, Viktoria Plzen
Group H: Juventus, Manchester United, Valencia, Young Boys