Ten-man AC Milan held out against a spirited Ajax in a scoreless draw at the San Siro to become Italy's sole survivors in the Champions League on Wednesday.
Earlier, Juventus exited the competition at the group stages after an 85th minute strike by Dutchman Wesley Sneijder handed Galatasaray a 1-0 win in Istanbul which secured second spot for the Turks in Group B behind Real Madrid.
And Milan were left as Italy's sole survivors in the knockout phase when Napoli went out on the head to head rule despite finishing level in the group with Borussia Dortmund and Arsenal.
It is the 11th season in succession seven-time champions Milan have made the last 16, knockout phase of Europe's premier club event and coach Massimiliano Allegri could not hide his relief.
"It's a huge relief. I think we lost a few kilos tonight," said Allegri, whose side played with 10 men for 71 minutes following the 19th minute sending-off of captain and midfielder Riccardo Montolivo.
Milan welcomed Frank De Boer's men to the San Siro stadium confident of claiming the point that would seal their entry to the knockout phase.
But after an auspicious start the Rossoneri's hopes suffered a huge blow when Montolivo saw red for a late tackle on midfielder Christian Poulsen.
Ajax shaded a fairly balanced first half and were unlucky not to have scored in the fifth minute when the woodwork saved Milan 'keeper Christian Abbiati after he had been beaten by Poulsen's header.
Yet despite Ajax enjoying most of the possession in a dominant second half and laying siege to the Milan goal, Allegri's men held firm to finish second in Group H behind Barcelona.
"The team really deserve this qualification. Against Ajax it was always going to be complicated, but it became even moreso after we were reduced to 10 men," said Allegri.
Ajax coach Frank De Boer said his side, held to a 1-1 draw by Milan in Amsterdam, did not deserve to exit the competition.
"Looking at the two matches, I would say we deserved more than to finish in third place," said De Boer, whose side drop into the Europa League.
Milan's only real chance of the opening half came in the fourth minute when striker Mario Balotelli tested Jasper Cillessen with a dipping free kick which the keeper got down low to collect.
Just a minute later Poulsen was unlucky to see his header from a corner sail over the Milan defence only to come off Abbiati's far post.
Ajax looked the far more relaxed team and in the 19th minute Abbiati had to be at full stretch to tip Danny Klaassen's brilliant diving header round the post after the winger met a low cross at the front post.
Minutes later Ajax's last 16 prospects were given a boost after Montolivo's needless stamp on Poulsen.
Allegri immediately withdrew forward Stephan El Shaarawy for midfielder Andrea Poli, but later said: "I'm sure Riccardo did not mean this tackle. He's not a brutal player like that."
De Boer said: "If you play the man and don't play the ball, then you deserve to be sent off."
De Boer upped the stakes for Milan when he replaced defensive midfielder Poulsen with forward Danny Hoesen for the start of the second half, when Ajax really turned up the heat.
However Milan dug their heels in.
"The match really became complicated for us after Riccardo's sending-off. We had to fight tooth and nail," said Milan defender Daniele Bonera.
Ajax set up camp in Milan's area for most of the second half but the hosts defended in numbers in a bid to repel the viitors' constant barrage of crosses and shots.
De Boer admitted: "It's not so easy to find space when there are eight men behind the ball. We had a lot of crosses and we did everything we could with long balls into the area, and putting on the extra striker.
"I can't say the lads didn't try everything. Of course, you have to have a little bit of luck."