Ten-man AC Milan resisted a spirited Ajax to hold the Dutch giants to a goalless draw and book their place in the last 16 of the Champions League on Wednesday.
Seven-time champions 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 captain Riccardo Montolivo saw red in the 19th minute 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 in the last quarter hour, Massimiliano 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, who required a win to leapfrog Milan into second place, looked the far more relaxed team and were passing the ball around with ease.
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 when Montolivo saw red for a needless stamp on Poulsen. Allegri immediately withdrew forward Stephan El Shaarawy for midfielder Andrea Poli.
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.
A shot by Viktor Fischer sailed wide while the forward was in a good shooting position and then defender Mattia De Sciglio came to Milan's rescue with a saving header while Abbiati was out of position following a cross from the right.
Ajax virtually set up camp but spurned a series of chances, Abbiati blocking Klaassen's angled drive to the right of goal with his feet and then Fischer missing two chances in quick succession.
Sensing the possibility of snatchin a draw, Allegri replaced Kaka with central defender Philippe Mexes with 10 minutes remaining.
By this time the Rossoneri had eight men lined up along the area and the strategy held firm as the hosts repelled a series of long balls, shots and cross into the area.
De Boer admitted Milan's defence had been difficult to penetrate: "It's always difficult to create chances, especially against Italian teams.
"But 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."