Defending champions Bayern Munich face Atletico Madrid after they were drawn together in Group A alongside Salzburg and Lokomotiv Moscow.
Lionel Messi and Cristiano Ronaldo will face each other for the first time in more than two years after their teams, Barcelona and Juventus, were drawn together on Thursday in the Champions League group stage.
The two sides, which met in the 2015 final, were paired in Group G along with Dynamo Kiev and Hungarian side Ferencvaros, who are back in the group stage after a 25-year absence.
Ronaldo and Messi, the two highest scorers in Champions League history with 130 and 115 goals respectively, have not clashed since the Portuguese left Real Madrid to join Juventus at the end of the 2017-18 season.
The pair have only met five times in the Champions League, most recently in 2011 when Barcelona beat Real 3-1 on aggregate in the semi-finals.
Defending champions Bayern Munich must face Diego Simeone's Atletico Madrid after they were drawn together in Group A alongside Salzburg and Lokomotiv Moscow.
The draw, held at a television studio in Geneva, produced several other high-profile clashes.
Paris St Germain and Manchester United will clash in Group H, English champions Liverpool face Ajax Amsterdam in Group D, which also features high-scoring Italians Atalanta, and Real Madrid play Inter Milan in Group B.
Group A: Bayern Munich, Atletico Madrid, Salzburg, Lokomotiv Moscow
Group B: Real Madrid, Shakhtar Donetsk, Inter Milan, Borussia Moenchengladbach
Group C: Porto, Manchester City, Olympiakos, Olympique de Marseille
Group D: Liverpool, Ajax Amsterdam, Atalanta, FC Midtjylland
Group E: Sevilla, Chelsea, Krasnodar, Rennes
Group F: Zenit St Petersburg, Borussia Dortmund, Lazio, Club Brugge
Group G: Juventus, Barcelona, Dynamo Kiev, Ferencvaros
Group H: Paris St Germain, Manchester United, RB Leipzig, Istanbul Basaksehir