Chelsea will play Sevilla, Krasnodar and Rennes in Group E, while Manchester City will face Porto, Olympiacos and Marseille in Group C.
Elsewhere, Cristiano Ronaldo will face Lionel Messi in the group stage as Barcelona and Juventus have been paired together in Group G along with Dynamo Kyiv and Ferencvarosi TC.
In Group A, holders Bayern Munich will take on Atletico Madrid, Salzburg and Lokomotiv Moscow.
In Group B, Eden Hazard will be reunited with his former manager Antonio Conte as Real Madrid will play Inter Milan, Shakhtar Donetsk and Borussia Monchengladbach.
Group F will see Zenit take on Borussia Dortmund, Lazio and Club Brugge.
CHAMPIONS LEAGUE DRAW IN FULL
Bayern Munich, Atletico Madrid, Salzburg, Lokomotiv Moscow
Real Madrid, Shakhtar Donetsk, Inter Milan, Borussia Monchengladbach
Porto, Manchester City, Olympiacos, Marseille
Liverpool, Ajax, Atalanta, FC Midtjylland
Sevilla, Chelsea, Krasnodar, Rennes
Zenit, Borussia Dortmund, Lazio, Club Brugge
Juventus, Barcelona, Dynamo Kyiv, Ferencvarosi TC
Paris Saint-Germain, Manchester United, RB Leipzig, Istanbul Basaksehir
The first matches of the group stage will be played on October 20 and 21, while matchday two will take place in the following week on October 27 and 28.
The final is due to be held at the Atatürk Olympic Stadium in Istanbul on May 29, 2021.