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'
|Did Carroll´s wondergoal give the West Ham striker whiplash?|
|Iniesta suffers calf injury|
|Swansea situation not ´hopeless´, says Clement|
|Real Sociedad 0 Barcelona 1: Neymar ends Anoeta curse|
|´Immeasurable bulls**t´ - Ligue 1 coach destroys Van Basten´s offside plan|
|Simeone praises Atletico´s precision in Copa Del Rey win|
|Fonte situation difficult for Southampton - Puel|
|´Some of the best football in the UK´ - Watford´s Mazzarri hails Bournemouth|
|Senegal 2 Zimbabwe 0: Cisse´s men charge into quarter-finals|
|Rivaldo backs Luis Enrique to deliver more Barca success|
|Atletico Madrid 3 Eibar 0: Routine win earns quarter-final lead|
|Jesus will make Premier League history - Rivaldo|
|Adebayor: Arsenal are just Ozil and Sanchez|
|Algeria 1 Tunisia 2: Favourites on brink of elimination|
|Bayern keen to seal Coman deal as Rummenigge cools Gnabry interest|
|Pochettino has done his homework on Jesus as Spurs look to march on|
|Scrap offside? Premier League managers give Van Basten´s plans a cool reception|
|Coman ready for Bayern comeback, confirms Ancelotti|
|Pochettino upbeat despite six weeks out for Vertonghen, Lamela still a mystery|
|Cerezo defiant over Griezmann amid talk of Manchester United agreement|
|Robinho named in Brazil squad for Chapecoense fundraiser|
|Davies and Lookman aren´t the big men of Everton, warns Koeman|
|Ivory Coast v DR Congo: Dussyer demands champions show true strength|
|Replacing Robben and Ribery not easy - Hitzfeld|
|Yeray back in Athletic training after successful cancer surgery|
|Karanka targeting more Boro deals after Bamford swoop|
|Cavani: I am the ultimate finisher|
|Morocco v Togo: El Ahmadi hungry for success|
|Ancelotti denies Verratti approach|
|A-League Review: Cahill double sees Melbourne City sink Mariners|
|Manchester United very happy with Shaw, insists agent|
|Mertesacker extends Arsenal deal|
|Boost for Arsenal as key quartet returns to training|
|Will Jesus save Manchester City´s title bid? Guardiola´s new striker in Opta numbers|
|Tevez mobbed after touching down in Shanghai|
|Payet exit not inevitable - Bilic|
|Wenger: Arsenal don´t need Payet|
|Jesus wants Manchester City titles|
|Orsolini arrives for Juventus medical|
|Rivaldo backs Coutinho to join Neymar at Barcelona|
|No danger of Messi leaving Barcelona, says father|
|Augusto: I convinced Oscar to come to China|
|Madrid-bound Maradona visits Napoli training|
|Sevilla in no rush over Sampaoli talks despite Barcelona links|
|Cafu: Resurgent Brazil can challenge world´s best|
|Klopp thrilled with Coutinho|
|Manchester United replace Real Madrid as world´s richest club|
|Madrid squad annoyed by defeats - Zidane wants more energy after latest loss|
|Casemiro rues more misery for Madrid against Celta|
|´Job done, let´s go home´ - Klopp happy to avoid extra time with narrow Plymouth win|
|FA Cup Review: Southampton leave it late to beat Norwich|
|Real Madrid 1 Celta Vigo 2: Aspas and Jonny extend Madrid winless run|
|Plymouth Argyle 0 Liverpool 1: Rare Lucas goal sees Klopp´s men through|
|Manchester City in La La Land as Schalke toil underground|
|Cameroon 2 Guinea-Bissau 1: Ngadeu-Ngadjui completes comeback to send Broos´ men top|
|Monaco confirm signing of Ajax teenager Antonucci|
|Manchester United´s interest in Griezmann is unsurprising - Simeone|
|Bamford ends spell in Chelsea wilderness with Boro return|
|Louis the great - Luis Enrique explains his and Barca´s debt to Van Gaal|
|Gabon 1 Burkina Faso 1: Spot-on Aubameyang makes his point|
|PSG send Ikone on loan to Montpellier|
|Senegal v Zimbabwe: Cisse wants to live up to favourites tag|
|Ghana´s Rahman leaves AFCON with knee injury|
|Algeria v Tunisia: Mahrez demands improvement in crucial Group B clash|
|Dortmund forward Dembele hits out at Bundesliga refereeing|
|Robben hopes Alonso stays at Bayern amid retirement rumours|
|Asian champions Jeonbuk banned from 2017 Champions League|
|Rakitic still an important player for Barcelona - Luis Enrique|
|Jesus will develop quicker at City - Emerson|
|Always take the weather with you - Spanish snow blights CSKA´s training camp|
|Messi never gave Coach interview, claims father|
|Gotze questions critics but admits to falling short of expecations|
|´Conte can have our title´ - Ranieri wants Chelsea to win the Premier League|
|Tottenham reject Premier League, Bundesliga offers for Wimmer|
|Liverpool sell Ilori to Reading|
|Potential victims in football abuse probe surpasses 500|
|Bonaventura signs new AC Milan contract|
|Messi: Ronaldo has achieved great things|
|Koscielny: Wenger has built men at Arsenal|
|Messi vows to stay at Barcelona ´for as long as they want me´|
|Cafu adamant Neymar will become world´s best|
|I´m just taking a sabbatical - Van Gaal denies he´s retired|
|Not even Gerrard won Premier League - Buttner says he´s not a United flop|
|Samper ignored Wenger as Barca midfielder rejected Arsenal|
|Pleased Pioli wants more from Inter|
|Evergrande boss Scolari dismisses Turan links|
|Klopp seeks legal advice over Matip|
|Marseille complete Sanson move|