Messi and Ronaldo are set to meet in a blockbuster tie as Barcelona play Juventus in Group G, while holders Bayern Munich play Atletico Madrid and Manchester United will play Paris Saint-Germain and RB Leipzig in the Champions League group stage.
Ole Gunnar Solskjaer’s side have been handed a tough draw on their return to the competition, with Turkey’s Istanbul Basaksehir the final side in their group.
Liverpool also face a difficult task, with Dutch champions Ajax and last season’s quarter-finalists Atalanta joining them in Group D along with Midtjylland.
Pep Guardiola’s Manchester City, beaten in last season’s quarter-finals, have been drawn against Porto, Olympiakos and Marseille.
While Chelsea will play Europa League winners Sevilla, Russian side Krasnodar and Rennes in Group E.
Elsewhere, Messi and Ronaldo are set to meet in a blockbuster tie as Barcelona play Juventus in Group G, while holders Bayern Munich play Atletico Madrid.
Champions League draw in full
Group A: Bayern Munich, Atletico Madrid, Red Bull Salzburg, Lokomotiv Moscow
Group B: Real Madrid, Shakhtar Donetsk, Inter Milan, Borussia Monchengladbach
Group C: Porto, Manchester City, Olympiakos, Marseille
Group D: Liverpool, Ajax, Atalanta, Midtjylland
Group E: Sevilla, Chelsea, Krasnodar, Rennes
Group F: Zenit Saint Petersburg, Borussia Dortmund, Lazio, Club Brugge
Group G: Juventus, Barcelona, Dynamo Kiev, Ferencvaros
Group H: Paris Saint-Germain, Manchester United, RB Leipzig, Istanbul Basaksehir
The group stages get underway in the week of October 19, with six rounds of group games running through to mid-December.
• Matchday 1: October 20/21
• Matchday 2: October 27/28
• Matchday 3: November 3/4
• Matchday 4: November 24/25
• Matchday 5: December 1/2
• Matchday 6: December 8/9
Whoever is lucky enough to go all the way will go head to head at the Ataturk Olympic Stadium in Istanbul – where Liverpool beat AC Milan back in 2005 – on May 29.