Neil Lennon and his squad were watching at Celtic's Lennoxtown's training ground when the draw was made in Monaco, placing them against three other European champions.
The Hoops, being drawn from pot four of the 32 qualifiers, were sent into one of the hardest groups, having to compete again with Barcelona after last year's triumph at Parkhead.
Lennon's side memorably beat Barca in last season's group stage last November with a dramatic late goal from Tony Watt.
Milan and Ajax add further glamour to the group. The four clubs between them have won 16 European titles.
Lennon told Sky Sports News: "I think it is the best and the worst draw we could have got.
"In terms of glamour I don't think it comes any better than Barcelona, Ajax and AC Milan.
"In terms of football it is probably the most difficult group we could have got.
"But I think the hard work was really done last night and we can go and enjoy the tournament now."
Arsenal face a daunting task after being drawn alongside last season's runners-up Borussia Dortmund, Rafael Benitez's Napoli and Marseille in the Champions League group stages.
The Gunners, who qualified after completing a comprehensive play-off win over Fenerbahce this week, were placed in the tough-looking Group F at UEFA's draw in Monaco.
Arsenal, who have reached this stage of the competition for 16 successive seasons, also played Dortmund in their group two years ago.
On that occasion Dortmund finished bottom of the section but the Germans are now a much tougher proposition and impressed throughout their run to the final last year.
Manchester City will again play reigning champions Bayern Munich - who they faced two years ago - CSKA Moscow and Viktoria Plzen in Group D.
After tough draws and disappointing group stage exits in each of the last two seasons, City had feared another hard set of fixtures.
But although they must take on Munich again, they may be relieved to be facing two of the continent's lesser lights in CSKA and Czech side Viktoria Plzen.
New manager Manuel Pellegrini has taken both Villarreal and Malaga to the latter stages of the competition and there would be disappointment if City failed to reach the knockout rounds again.
City captain Vincent Kompany tweeted: "Interesting draw. Big year for us."
David Moyes' Champions League bow with Manchester United will come against Shakhtar Donetsk, Bayer Leverkusen and Real Sociedad in Group A.
Chelsea face two of the sides they conquered en route to last year's Europa League success in Basle and Steaua Bucharest, as well as Schalke, in Group E.
For United and Chelsea, the tasks look reasonably straightforward. Moyes will be expected to guide a side that has reached the final three times since 2008 through the likes of Donetsk, Leverkusen and Sociedad.
Jose Mourinho's Chelsea, the 2012 winners and current holders of the Europa League, will be favourites to top Group E.
The full draw is:
Group A: Manchester United, Shakhtar Donetsk, Bayer Leverkusen, Real Sociedad
Group B: Real Madrid, Juventus, Galatasaray, Copenhagen
Group C: Benfica, Paris St-Germain, Olympiakos, Anderlecht
Group D: Bayern Munich, CSKA Moscow, Manchester City, Viktoria Plzen
Group E: Chelsea, Schalke, Basel, Steaua Bucharest
Group F: Arsenal, Marseille, Borussia Dortmund, Napoli
Group G: Porto, Atletico Madrid, Zenit St Petersburg, Austria Vienna
Group H: Barcelona, AC Milan, Ajax, Celtic