Ten-man Milan were made to sweat in their 3-1 win against Parma at Stadio Ennio Tardini after having Zlatan Ibrahimovic sent off for dissent as they tightened their grip on second place in Serie A.
Last week's 1-1 home draw with Sampdoria all but ended the Rossoneri's Scudetto hopes, but they responded with all three points on Saturday to boost their top-four prospects.
Ibrahimovic claimed an impressive assist for Ante Rebic's early opener and played a big part in Franck Kessie's goal that had Milan in control at the midway point.
However, the veteran striker was dismissed on the hour mark for something he said to the referee and Riccardo Gagliolo pulled back a goal soon after, but substitute Rafael Leao settled Milan's nerves with a third goal in added time.
The visitors had scored on each of their last seven away league visits to Parma and took just eight minutes to open the scoring in this latest meeting.
Ibrahimovic acrobatically controlled a pass 30 yards from goal before playing in Rebic to turn his man and fire away from Luigi Sepe into the top-right corner.
Milan have dropped just two points from winning positions this term and went further ahead before half-time, with Kessie slotting home once played through by Theo Hernandez.
Parma would have reduced the arrears early in the second half if not for Gianluigi Donnarumma's double save to keep out Andrea Conti's header and Graziano Pelle's follow-up.
But the home team were then given a big lifeline when Ibrahimovic was shown a straight red card by referee Fabio Maresca, seemingly for something he said after a free-kick was awarded against his side.
Gagliolo turned in Pelle's headed pass six minutes later and that paved the way for Parma to throw bodies forward in search of an equaliser.
The strugglers could not truly test Donnarumma in the remainder of the game, though, and they were picked off late on as Diogo Dalot raced clear and slid in an unmarked Leao to round off a counter.
What does it mean? Milan closing in on Champions League spot
This 15th away win in 17 away Serie A matches moves Milan back to within eight points of leaders Inter, but their bitter rivals also have a game in hand to play.
Despite what Inter boss Antonio Conte may suggest, the Scudetto battle is effectively over with six weeks of the season to go, but the top-four race is set to go all the way.
Stefano Pioli's men are seven points better off than fifth-placed Napoli, who play their game in hand at Sampdoria on Sunday, while Juve and Atalanta are also hot on Milan's heels.
Kessie into double figures
The Ivory Coast international was denied by a good Sepe save early on but found a way through at the end of the first half, while his 45 successful passes was the joint-most of any visiting player, alongside Ismael Bennacer.
That strike was Kessie's 10th league goal of 2020-21, making him the first Milan midfielder to reach that figure in the first 30 games of a Serie A season since Kaka in 2008-09.
Ibra makes life tough for Milan
The Sweden international showed in the first half just why Milan are so desperate to tie him down to another contract by playing a key part in both goals.
However, he showed the other side of his game in the second half, even if the sending-off did seem harsh on the face of it. It was the eighth red card he has received in Europe's top five leagues since February 2012.
Parma travel to fellow strugglers Cagliari in a huge relegation six-pointer next Saturday, while Milan host Genoa at San Siro the following day.