Real Madrid ended up in pot two after finishing second in their group behind Paris St Germain and City were the unlucky team to be paired with them when their name was pulled out at UEFA headquarters.
City, who will be at home in the second leg, have yet to beat the Spanish side with two draws and two defeats in their previous four meetings.
However, their manager Pep Guardiola has a much more encouraging record with nine wins, four draws and four defeats in 17 meetings as coach of Barcelona and then Bayern Munich.
“It’s a difficult one,” said Manchester City’s director of football Txiki Begiristain. “Real Madrid are the best. We want to be the best so we have to try and beat them. It’s always a pleasure to play against Real Madrid. We know them very well. They know our manager.”
Liverpool and Atletico Madrid’s previous meetings have produced one win for each team and two draws with both teams scoring four goals.
Only Europe’s biggest five leagues — England, France, Germany, Italy and Spain — were represented in the draw and 11 of the 16 teams also reached the knockout stages last season.
Both England and Spain managed to get all four of their teams into knockout stages. Elsewhere, Serie A champions Juventus will face French side Olympique Lyonnais and PSG will play Borussia Dortmund.
Barcelona were pitted against an unpredictable Napoli, the first time the two sides have ever met.
Napoli fired coach Carlo Ancelotti immediately after beating Genk to make sure of their place in the last 16 and replaced him with Gennaro Gattuso, who has never coached in the Champions League before.
“A great team, a great challenge, two fascinating races. We will face them without fear,” he said.
Jose Mourinho’s Tottenham Hotspur side, who reached the final last season, will play RB Leipzig, who are in the knockout stages for the first time, while Chelsea were drawn against Bayern Munich.
Despite their erratic domestic form, Bayern were the only team to complete the group stage with a 100% record.
Serie A side Atalanta, who reached the last 16 on their first participation in the Champions League despite losing their first three group matches, were drawn against Valencia.