Milan edged into the last 16 of the Europa League on away goals after being held to a 1-1 draw by 10-man Red Star Belgrade at San Siro.
Reeling from Red Star's last-gasp equaliser in the first leg and Sunday's 3-0 derby defeat to Serie A title rivals Inter, Milan just did enough to secure their progress on Thursday – and they had birthday boy Gianluigi Donnarumma to thank.
Franck Kessie's early penalty put Milan 3-2 up on aggregate, but Red Star hit back through El Fardou Ben.
With Milan profligate at the other end, 22-year-old Donnarumma had to pull off an outstanding stop to deny Sekou Sanogo, before Marko Gobeljic's red card dented Red Star's comeback hopes.
A penalty was the reward for Milan's bright start when VAR adjudged Gobeljic to have purposefully handled Rade Krunic's shot.
Kessie made no mistake from the resulting spot-kick, his thumping strike sending Milan Borjan the wrong way.
Yet Red Star fought back, and after Ben saw a goal disallowed and hit the crossbar with a wicked free-kick, the Red Star winger drilled a crisp finish beyond Donnarumma.
Diogo Dalot should have restored Milan's lead, yet struck straight at Borjan, and he was almost punished when Guelor Kanga's thunderous hit whistled wide.
Stefano Pioli wasted no further time in attempting to wrest back control, introducing Zlatan Ibrahimovic and Ante Rebic at the interval.
The duo almost combined eight minutes after the restart – Rebic just failing to divert Ibrahimovic's header home.
Donnarumma came up with a reminder of his talent after the hour, somehow keeping out Sanogo's close-range volley, with Gobeljic slicing wide on the rebound.
Gobeljic compounded Red Star's frustration moments later when he charged in on Hakan Calhanoglu to pick up a second booking, and though Alexis Saelemaekers had a goal disallowed for offside, Milan nevertheless made their numerical advantage count to advance.
What does it mean? Rossoneri condemn frustrating European run to the history books
Milan had been eliminated from each of their last seven two-legged ties in major European competition when failing to win the first leg, last progressing from such a position in the 2006-07 Champions League semi-finals against Manchester United.
Carlo Ancelotti's Milan side went on to win the competition that season, and Pioli will be hoping history repeats itself – albeit in UEFA's second-tier tournament.
Kessie spot on
Former Atalanta midfielder Kessie has now netted eight goals in all competitions this season – seven times in Serie A and once in the Europa League.
It is already Kessie's best tally in a campaign, and he capped another all-action performance with his superb penalty. Of his eight goals, seven of them have been spot-kicks.
Leao flounders up front
Asked to lead the line with Ibrahimovic on the bench, Rafael Leao endured a difficult first-half performance.
Leao managed just eight touches, though they did produce two attempts – neither were on target, while he made just four passes before he was hauled off at half-time.
While Proleter Novi Sad are Red Star's next opponents in the Serbian top flight, Milan face Roma – who are just five points behind them in Serie A – on Sunday
Europa League last 32, second leg results on Thursday (first-leg scores in brackets):
Ajax (NED) 2 (Klaassen 15, Neres 88) Lille (FRA) 1 (Yazici 78-pen)
Ajax win 4-2 on aggregate
Shakhtar Donetsk (UKR) 1 (Junior Moraes 67-pen) Maccabi Tel Aviv (ISR) 0
Shakhtar win 3-0 on aggregate
At Naples, Italy
Napoli (ITA) 2 (Zielinski 3, Fabian Ruiz 59) Granada (ESP) 1 (Montoro 25)
Granada win 3-2 on aggregate
At Sinsheim, Germany
Hoffenheim (GER) 0 Molde (NOR) 2 (Andersen 20, 90+5)
Molde win 5-3 on aggregate
At Vila-real, Spain
Villarreal (ESP) 2 (Gerard Moreno 40, 89-pen) Salzburg (AUT) 1 (Berisha 17)
Villarreal win 4-1 on aggregate
At Glasgow, Scotland
Rangers (SCO) 5 (Morelos 9, Patterson 46, Kent 55, Barisic 59-pen, Itten 90+2-pen) Antwerp (BEL) 2 (Refaelov 32, Lamkel Ze 57)
Rangers win 9-5 on aggregate
At Piraeus, Greece
Arsenal (ENG) 3 (Aubameyang 21, 87, Tierney) Benfica (POR) 2 (Diogo Goncalves 43, Rafa Silva 61)
Arsenal win 4-3 on aggregate
At Eindhoven, Netherlands
PSV Eindhoven (NED) 2 (Zahavi 23, 44) Olympiakos (GRE) 1 (Ahmed Hassan 88)
Olympiakos win 5-4 on aggregate
At Leverkusen, Germany
Bayer Leverkusen (GER) 0 Young Boys (SUI) 2 (Siebatcheu 48, Fassnacht 86)
Young Boys win 6-3 on aggregate
Dinamo Zagreb (CRO) 1 (Orsic 31) Krasnodar (RUS) 0
Dinamo win 4-2 on aggregate
Roma (ITA) 3 (Dzeko 24, Perez 75, Mayoral 90+1) Braga (POR) 1 (Cristante 88-og)
Roma win 5-1 on aggregate
At Leicester, England
Leicester City (ENG) 0 Slavia Prague (CZE) 2 (Provod 49, Sima 79)
Slavia win 2-0 on aggregate
At Milan, Italy
AC Milan (ITA) 1 (Kessie 9-pen) Red Star Belgrade (SRB) 1 (Ben Nabouhane 24)
Aggregate score 3-3; Milan win on away goals
At Manchester, England
Manchester United (ENG) 0 Real Sociedad (ESP) 0
Manchester United win 4-0 on aggregate
At Bruges, Belgium
Club Brugge (BEL) 0 Dynamo Kiev (UKR) 1 (Buyalskiy 83)
Dynamo win 2-1 on aggregate
Tottenham Hotspur (ENG) 4 (Alli 10, Carlos Vinicius 50, 83, Bale 73) Wolfsberg (AUT) 0
Tottenham win 8-1 on aggregate