(CNN) -- Substitute Pedro Leon scored an injury time equalizer as Real Madrid claimed a last-gasp 2-2 Group G draw at AC Milan, a result that ensured qualification into the last 16 of the Champions League on Wednesday.
Leon fired the ball between the legs of Milan goalkeeper Christian Abbiati, after being put superbly through by fellow-substitute Karim Benzema, to give Jose Mourinho's side the point they needed to reach the knockout stages.
Gonzalo Higuain had given the Spanish giants the lead on the stroke of half-time, turning and firing home Angel Di Maria's pass after Alessandro Nesta had played the Argentine striker on-side.
But Milan coach Massimiliano Allegri brought veteran striker Fillippo Inzaghi on for the second half and the 37-year-old turned the match on its head with two goals within the space of 10 minutes.
In the 68th minute Zlatan Ibrahimovic took advantage of a slip by Pepe before firing in a cross that goalkeeper Iker Casillas spilled, allowing Inzaghi to nod the ball into an empty net.
Then, Inzaghi ran onto Gennaro Gattuso's through-pass, although the striker appeared a yard offside, before shooting the ball past an on-rushing Casillas.
But Leon had the last word to ensure Mourinho had a happy return to the San Siro following his two years as coach of AC Milan's city rivals Inter.
Madrid lead the table with 10 points, double the total of second-placed Milan. Ajax remain in third place on four points despite losing 2-1 at Auxerre.
A late winner from substitute Steeven Langil gave Auxerre their first points in the group stage to keep their qualification hopes alive.
Meanwhile, history was made in Group F as Marseille won 7-0 at Slovakian side Zilina, the largest away victory in the history of the Champions League.
France international striker Andre-Pierre Gignac scored a hat-trick -- one goal with his head, one with his left foot and one with his knee, as the French side ran riot.
Lucho Gonzalez netted twice while Loic Remy and Gabriel Heinze also found the net in a stunning triumph.
Marseille are now on six points, level with Spartak Moscow who crashed 4-1 at Chelsea -- the London side ensuring qualification by maintaining their 100 per cent record.
Defender Branislav Ivanovic, who netted the winning goal in the Premier League at Blackburn at the weekend, scored twice more for Chelsea, with Nicolas Anelka and a Didier Drogba penalty completing a comfortable victory.
Nikita Bazhenov scored a consolation goal for the Russian side but it could not prevent the Blues going through to the knockout stages by topping the group.
Spartak and Marseille meet later in the month in Moscow with seoncd place in the group up for grabs, with Zilina's qualification hopes are now over.
Last season's runners-up Bayern Munich are the only other side with a 100 per cent record from four matches, after Mario Gomez scored a hat-trick in their 4-0 Group E victory at Romanian champions Cluj.
Thomas Muller scored Bayern's fourth and final goal in injury time as Louis van Gaal's team ensured their qualification with a maximum 12 points.
Roma are second in the group after a hard-fought 3-2 win against Basel in Switzerland, but the Serie A side are only on six points and runners-up spot in the group is still up for grabs.
Arsenal remain top of Group H, but they lost their 100 per cent record after a 2-1 defeat at Shakhtar Donetsk.
Theo Walcott put The Gunners ahead, but a Craig Eastmond own goal and a winner from former Arsenal striker Eduardo meant the Ukrainian side drew level with the Londonders at the top of the group table.
The other group game saw Sporting Braga win 1-0 at Partizan Belgrade, a result that keeps the Portuguese team in the hunt on six points, but the Serbs cannot now qualify.