Mario Balotelli and Philippe Mexes scored late on at Siena as Milan came from behind to secure a place in the UEFA Champions League.
Balotelli’s 84th-minute penalty had cancelled out Claudio Terzi’s first-half header, before Mexes netted a crucial winner three minutes from time.
A hard-fought second half saw both sides reduced to 10 men in the space of just a few minutes after Massimo Ambrosini and Christian Terlizzi were both sent off for second bookable offences.
But it was the late goals that made all the headlines as Milan guaranteed their place at European football's top table in dramatic circumstances.
Milan came into the game needing to win in order to beat Fiorentina to the final UEFA Champions League place, and they made five changes to the team that played out a controversial 0-0 draw with Roma last week.
Sulley Muntari's bizarre red card in that game meant that he was suspended, while Ignazio Abate was preferred ahead of Kevin Constant.
Robinho, Antonio Nocerino, Riccardo Montolivo and M'Baye Niang were all handed starts.
Siena, whose relegation was confirmed with a 2-1 loss away to Napoli, welcomed back Alessandro Rosina.
Milan began the game with an expected level of urgency, creating a flurry of chances during the opening exchanges.
Balotelli was the first to test Gianluca Pegolo in the Siena goal, seeing his stinging long-range effort tipped over the crossbar.
A few moments later, Cristian Zapata saw a header cleared off the line before Brazilian Robinho was unlucky not to break the deadlock when he saw his vicious swerving shot palmed away by Pegolo.
And Milan were made to pay for their profligacy just before the half-hour mark when the hosts took an unlikely lead through Terzi.
A pinpoint free-kick from Rosina found the head of the defender, who took advantage of some slack Milan marking to direct his header past Chrisitan Abbiati.
Milan nearly conjured up the perfect response just two minutes later, when Balotelli crashed a shot onto the crossbar.
And the Italian was involved again just before half-time, forcing a decent save from Pegolo as Siena weathered the Milan storm.
The second half began in similarly frustrating circumstances for Milan, as they struggled to find a decisive final ball. And 10 minutes later they were down to 10 men when Ambrosini slid in rashly on Adrian Callelo and was shown a second yellow card.
The numbers were even soon after, though, as the home side were also down to 10 men - Terlizzi given his marching orders for jumping into a challenge with Balotelli.
Balotelli made his mark in some style 10 minutes from time when he was brought down in the box by Felipe to give Milan hope.
The Italian brushed himself down to calmly slot home the resulting spot-kick and the comeback was on.
Then, with just two minutes to go, Mexes found himself on the end of a Montolivo cross to slot home the dramatic winner.
|88||C. Terlizzi||45' 70'|
|14||F. Della Rocca|
|Coach: G. Iachini|
for A. Rosina 61'
for I. Emeghara 75'
for M. Rubin 89'
|Emery bids farewell to Sevilla|
|Messi will pick himself up from Argentina woe - Pique|
|Vrsaljko´s Atletico move set to be confirmed|
|Berardi wants game time - Di Francesco|
|Giaccherini hails Conte: We prepared for tiniest details|
|Shearer puts his hand up for England job|
|Juventus ´hard to beat´ because of finances - Napoli president|
|Nainggolan ´very happy´ at Roma amid Chelsea links|
|Maradona calls on Messi to continue with Argentina|
|Europe ´vastly underrated´ Italy - Buffon|
|Iniesta: Spain were too focused on Italy|
|Spain not up to required level - Pique|
|Hallgrimsson: Quick equaliser rocked England|
|Rooney intends to continue with England|
|Apologetic Hart ´devastated´ by Iceland defeat|
|Hodgson had to go after humiliating England exit|
|´It is embarrassing to go out´ - Rooney|
|Lagerback lauds Hodgson after Iceland stun England|
|England pathetic and disgraceful - the world reacts to Hodgson departure|
|Roy Hodgson´s England career in numbers|
|Hodgson resigns: Five contenders to replace him as England boss|
|Chiellini delighted to end Italy´s Spain pain|
|Alderweireld wary of Wales and Bale|
|Euro 2016 Diary: A lost child, a football ban in Nice and one last stand for Will Grigg|
|Sigurdsson: England thought it would be a walk in the park|
|Bonucci hails ´master´ Conte|
|Hodgson resigns following Euro 2016 exit|
|England 1 Iceland 2: Fairytale continues as Hodgson´s men crash out|
|Sevilla confirm Sampaoli appointment|
|Del Bosque: I am not quitting - yet|
|Conte eyes second Italy stint after downing Spain|
|Conte masterclass marks end of an era for Spain|
|Italy 2 Spain 0: Chiellini and Pelle send holders crashing out|
|Substance over style for Portugal´s Fonte|
|Robinson agrees one-year deal at Burnley|
|FFP could hold up Toure switch to Inter, claims agent|
|Dani Alves completes Juventus move|
|Coleman confident Williams will be fit to face Belgium|
|Iordanescu to leave Romania post|
|Messi decision sad – Griezmann|
|Blanc wishes PSG successor luck|
|No goals or assists in Argentina finals: The best stats from Messi´s international career|
|Eleven trophies and records galore: The best stats from Blanc´s PSG reign|
|Griezmann at home in the centre|
|Forest appoint Montanier|
|Manchester United to get Mkhitaryan answer this week|
|Raffael extends contract with Borussia Monchengladbach|
|Mane closes in on Liverpool move|
|Blanc departs PSG with Emery waiting in the wings|
|O´Neill hopeful of Republic of Ireland stay|
|Lewandowski does not faze Fonte|
|Wales better as underdogs – Coleman|
|Beckenbauer would prefer Germany to play Spain, not Italy|
|Messi retirement highlights implosion of Argentinian football|
|Bravo: I hope Messi continues playing for Argentina|
|Aguero: Messi not the only player considering retirement|
|I think Messi is just upset, Romero says after captain announces retirement|
|Aguero: This is the worst I have seen Messi|
|Messi set to retire from international football|
|Sanchez: This is the best thing to happen to me|
|Martino: Argentina deserved to beat Chile in final|
|Vidal: This Chile generation is to stand|
|Sanchez crowned Copa´s best as champions Chile sweep awards|
|Argentina 0 Chile 0 (aet, 2-4 on penalties): Defending champs sink Messi and Co. again|
|Taylor ready for Belgium test|
|Portland Timbers 3 Houston Dynamo 2: Valeri late show seals win|
|Euro 2016 Diary: Love blossoms in Paris and last orders for Ireland as Hallgrimsson baits England|
|De Bruyne, Belgium target Euro 2016 final|
|Wilmots: Hazard does his talking with his feet|
|Storck enthusiastic about Hungary future|
|My best Belgium performance - Hazard|
|´It took him long enough!´ - Schweinsteiger hails Boateng´s first Germany goal|
|Courtois: Hungary made an error by coming to play|
|No back-three fears for Spain boss Del Bosque|
|Grigg fired by Euro bench duty|
|Davis: Stranger things have happened than O´Neill to Southampton|
|Gunnarsson insists Iceland do not fear England|
|Brilliant Hazard inspires Belgium´s golden boys|
|Student Morata wants to bring down Juventus masters with Spain|
|Hungary 0 Belgium 4: Hazard inspires Wilmots´ men into quarter-finals|
|Conte demands extraordinary Italy to topple Spain|
|Nolito: No contact with Barca or Man City|
|Alves jets into Turin for Juve medical|
|Low: No sleepless nights over Italy or Spain|
|Kozak: Germany had too much quality|
|Fury gets in the spirit with England fans in Nice|
|Draxler shares the plaudits as Germany move through|
|O´Shea not drawn on Ireland future|
|Rami: France were scared of going out|
|Germany 3 Slovakia 0: Spain or Italy await for world champions after comprehensive win|
|Brilliant Boateng gets Germany juggernaut motoring|
|Lagerback hopes England´s attacking struggles will continue|
|Juventus, Napoli and Roma ´all interested in De Sciglio´|
|O´Neill hails coming of age for Ireland´s youngsters|
|England will not disrespect Iceland, says Rooney|
|Deschamps stands firm on team changes|
|Hodgson adamant he is happy with England strikers|
|Evra: We knew it would be difficult|
|Deschamps: We had to dig deep|
|Rooney: Do not question Sterling´s attitude|
|O´Neill: France´s extra rest took its toll|
|France star Payet: It is difficult to stop us|
|Griezmann: Stern words led to second-half fightback|
|Coleman: We felt it was there for us|
|Deschamps defies doubters as France heed call to arms|
|Konko ´in talks´ to join AC Milan|
|Sigurdsson looking forward to dream England clash|
|Cacic: Croatia´s time will come|
|Italy v Spain will be different to Euro 2012 final - Camoranesi|
|France 2 Republic of Ireland 1: Griezmann double rescues hosts|
|Capello: Spain are pure magic|
|Wolfsburg complete Bruma signing|
|Koke: Spain need to bring back ´The Red Fury´|
|Pizzi: Chile can beat Messi and Argentina|
|Schalke swoop for Swiss star Embolo|
|Subotic signals intention to leave Dortmund|
|Howedes eager for France showdown|
|Russia confirm Slutsky resignation|
|Pirlo: Italy out for Spain revenge|
|Vokes consoles McAuley after Wales march on|
|Italy-Spain a battle of world´s best - Llorente|
|Messi one win away from becoming the greatest|
|Play-offs the goal as Baptista settles into life in Orlando|
|Colombia closer to winning titles - Pekerman|
|MLS Review: Kaka scores 100th-minute penalty in thriller, Lampard inspires NYC|
|Portugal ´don´t have a clue how they scored´ – Rakitic|
|Klinsmann: USA should be proud of Copa America display|
|United States 0 Colombia 1: Bacca secures third place at Copa America|
|Corluka: Portugal among worst teams at Euro 2016|
|Sanches happy to be involved as Portugal reach quarters|
|Euro 2016 Diary: Shaqiri rivals Pique for Shakira´s affection, Bale reveals secret weapon|
|Morata: I have nothing to prove to Zidane|
|Di Maria fit for Copa final|
|´You do not always win by playing prettily´ - Santos unconcerned by dour Portugal|
|The best team lost, says disconsolate Cacic|
|Fabianski: Poland must create more for Lewandowski|
|McAuley pride after crushing Wales loss|