In other eye-catching matches, unbeaten German League leaders VfB Stuttgart will meet English League leaders Chelsea, Porto face Manchester United and reigning champions AC Milan play Sparta Prague.
The 16-team round is completed with Real Sociedad against Olympique Lyon, Celta Vigo v Arsenal, Deportivo Coruna v Juventus and Lokomotiv Moscow v AS Monaco.
The first legs will be played on February 24/25 with the returns on March 9/10.
Real and Bayern have between them lifted the European Cup 13 times and on each of the last three occasions they have met in the competition the winner has gone on to lift the trophy.
Real won the last tie 3-2 on aggregate in the quarter-finals in 2002 but Bayern have won six of the eight games between the clubs since February 2000. In all they have met 14 times in Europe, with Bayern winning nine matches, Real four and one game drawn.
In 2000 Bayern won both games between the two in the second group stage but Real won their semi-final 3-2 on aggregate and went on to beat Valencia in final.
Bayern triumphed in the 2001 semis (aggregate 3-1) when they too then beat Valencia in the final, only for Real to hit back in the 2002 quarters ahead of wins over Barcelona in the semis and Bayer Leverkusen in the final.
The two sides didn't meet last season -- when AC Milan took the title.
Bayern coach Ottmar Hitzfeld said: "We will play against the best team in the world with all their top stars. It will be a great challenge."
Goalkeeper Oliver Kahn added: "This is perhaps the best thing that could happen to us. It's the definite challenge with two games in which we will have nothing to lose."
Playmaker Michael Ballack said: "Real wanted any team but Bayern but we are delighted with the draw. Those two games will be absolute highlights for us and for our fans."
TRICKY TIE
Defending champions Milan will be pleased to have drawn Sparta Prague, while Juventus, last season's beaten finalists, go up against a Deportivo side they met last season in the second group stage - drawing 2-2 in Spain and winning 3-2 in Italy.
Manchester United were handed a tricky tie against Portuguese league leaders Porto, the winners of the UEFA Cup last season.
They last met in the 1996-97 season when United beat them 4-0 on aggregate in the quarter-finals.
The leaders of the English premier league and the Bundesliga will face off as Chelsea play VfB Stuttgart, who they beat 1-0 in the European Cup Winners Cup final in 1998.
Arsenal, the third English team to make the last 16 and desperate to make the quarter-finals after four failures in their last five attempts, will fancy their chances after being paired with Celta.
One man happy with the draw was Lyon coach Paul Le Guen, who said beforehand that he hoped to play Sociedad as they are coached by his friend and ex-Nantes team mate Reynald Denoueix.