Arsenal will face Harry Kane's Bayern Munich, while Paris Saint-Germain meet Barcelona and Atletico Madrid will take on Borussia Dortmund in the other ties. Pep Guardiola's City will travel to the Spanish capital for the first leg on April 6 or 7, with the return in Manchester a week later.
City beat Madrid in the semi-finals last season on the way to winning the Champions League for the first time, following a 1-1 draw at the Santiago Bernabeu with a stunning 4-0 victory at home in the second leg.
Real came out on top when the teams met in the last four a year earlier, before going on to defeat Liverpool in the final. The Spanish giants also won a semi-final clash between the teams in 2016, while City emerged victorious in the last 16 in 2020.
The draw threw up a set of mouthwatering ties with Arsenal being rewarded with a tie against German champions Bayern after beating Porto on penalties to qualify for the quarter-finals for the first time since 2010.