The trio became the first teams to qualify for the knockout stages of the Champions League while Arsenal, who could have joined them, will have to wait.
Real, Bayern, Chelsea first into knock-out stages
LONDON // Real Madrid, Bayern Munich and Chelsea became the first teams to qualify for the knock-out stages of the Champions League on Wednesday while Arsenal, who could have joined them, will have to wait.
Real Madrid, attempting to win at the San Siro for the first time in their 14th attempt dating back to 1956, led AC Milan with a Gonzalo Higuain goal just before half-time in their Group G match.
Two second half goals from substitute Filipo Inzaghi, however, looked like giving Milan a 2-1 victory and ruining the Madrid manager Jose Mourinho's return to the city where he coached Inter to the European crown last season.
But a strike four minutes into stoppage time from Pedro Leon salvaged a 2-2 draw and a place in the last 16 for Real with almost the last kick of the game.
A hat-trick from Mario Gomez gave Bayern, last season's runners-up, a comfortable 4-0 away win over CFR Cluj in Romania with their fourth successive win in Group E.
Chelsea maintained their perfect record in Group F with a 4-1 win over Spartak Moscow thanks to goals from Nicolas Anelka, Didier Drogba (penalty) and Branislav Ivanovic (2).
Spartak stayed second despite Olympique Marseille's astonishing record 7-0 away win at Zilina, the biggest away victory in the Champions League proper, and only one short of Liverpool's overall record 8-0 victory over Besiktas at Anfield three years ago this week.
While Real, Bayern, Chelsea and Marseille were all celebrating, Arsenal let their chance slip and will have to wait to qualify.
Arsenal took the lead at Shakhtar Donetsk with a superb goal on the run from Theo Walcott, but Donetsk struck back to win 2-1 with Dmytro Chygrynskiy's deflected header and a second from the former Arsenal player Eduardo as Arsenal dropped points for the first time.