Barcelona will travel for the first leg against seven-time winner Milan, in a quarterfinals clash that reunites the two European powers after they met in the group stage.
Madrid, the nine-time winner, got the most favourable draw — playing away first against the competition's surprise team APOEL of Cyprus.
Chelsea will play away to Benfica first in their quarterfinal. Marseille was drawn at home first against Bayern Munich, which hosts the final on May 19.
Quarterfinals first-leg matches are played on March 27-28, and return matches are on April 3-4.
In the subsequent semifinals draw, Marseille or Bayern will host APOEL or Madrid in the first leg.
Benfica or Chelsea will play at home first against Milan or Barcelona. Semifinals first legs are played on April 17-18 and return matches on April 24-25.
Barcelona had the best of Milan in the group stage, drawing 2-2 at home before winning 3-2 in a high-class encounter at San Siro.
"It is a psychological advantage," said Barcelona director Amador Bernabeu, anticipating another meeting with Milan's former Barca forward Zlatan Ibrahimovic. "But to play Ibra is another thing. We respect him all the time."
Milan coach Massimiliano Allegri said his players would face "the strongest team in the world."
"But we can do well, because we've improved since the last time we faced them, when we played a good defensive match in Barcelona and another just as good match in the return leg, even if we lost at home," Allegri said.
Madrid arguably had most to be happy about — avoiding the drama of facing either Barcelona or a reunion for Real coach Jose Mourinho with his former team Chelsea.
"We are glad to avoid them, it's true, but it doesn't mean we are in the semifinals," Madrid director Emilio Butragueno said. "APOEL is the big surprise. They have all our respect."
APOEL, which started in the second qualifying round last July, is the first Cypriot team to advance so far in the world's most prestigious club competition.
"It's a dream, an experience for us,"APOEL chairman Phivos Erotokritou said. "To have Real playing in Cyprus is going to be a feast for the people. We're happy that the first game is at home in Nicosia because you imagine if the first game was away with a result we couldn't bear."
Still, APOEL has shown resilience by progressing to the last-eight while scoring just seven goals in its past eight games.
Bayern scored as many last Tuesday alone, beating Basel 7-0 to overcome a single-goal defeat in Switzerland. The four-time European champion now faces 1993 winner Marseille.
"They got past Inter Milan, we have to be cautious. We have to try to get a good result already in Marseille," Bayern chairman Karl-Heinz Rummenigge said. "If you look at other pairings, like Milan against Barcelona, then we have to be pleased with the draw."
Chelsea and its former Benfica players David Luiz and Ramires will travel to play the first leg in Lisbon, after its comeback victory in extra time against Napoli on Wednesday.
"We came into it looking for an away game in the first leg, which we got," Chelsea chief executive Ron Gourlay said. "We're really just delighted to be here."
Chelsea's run is seen as a last chance to lift the trophy for the core group of Mourinho-era players, who lost the 2008 final in a penalty shootout against Manchester United.
"Everyone knows Chelsea's potential," Benfica sports director and former player Rui Costa said, adding: "We're ready for anything."Suggest a correction