Holders Liverpool will face Chelsea in the Champions League group stages this season as they look to defend their trophy.
Rafael Benitez's side defeated Chelsea in the semi-final last season - with a controversial goal from Luis Garcia the only goal of the tie - before beating AC Milan in the final.
Television replays could not prove if Luis Garcia's goal at Anfield crossed the line, but the goal stood and Liverpool held on for famous win against Jose Mourinho's side.
Belgian side Anderlecht were also drawn in Group G. Spanish side Real Betis complete a strong group, with Mourinho and Benitez facing a stern test to reach the knock-out stages.
Manchester United will be happy with their draw although they will face former striker Diego Forlan in Group D.
United and Villarreal will also face French side Lille and Portuguese side Benfica.
Arsenal, meanwhile, will face Dutch giants Ajax in Group B, along with Sparta Prague of the Czech Republic and Swiss side Thun.
Artmedia Bratislava, who humbled Celtic in a qualifier, have another chance against Scottish opposition when they face Rangers in Group H.
Both sides, however, will find it tough to get out of a group which also includes 2004 winners Porto, and Inter Milan.
Nine-times winners Real Madrid were grouped with Olympique Lyon, Olympiakos Piraeus and Rosenborg Trondheim.
Group A
Bayern Munich
Juventus
Club Brugge
Rapid Vienna
Group B
Arsenal
Ajax
Sparta Prague
FC Thun
Group C
Barcelona
Panathinaikos
Werder Bremen
Udinese
Group D
Manchester Utd
Villarreal
Lille
Benfica
Group E
AC Milan
PSV
Schalke 04
Fenerbache
Group F
Real Madrid
Lyon
Olympiakos
Rosenborg
Group G
Liverpool
Chelsea
Anderlecht
Real Betis
Group H
Inter Milan
FC Porto
Rangers
Artmedia Bratislava