A last-gasp Nikola Milenkovic own goal handed Milan a 2-1 victory over Fiorentina at San Siro on Sunday to cut Napoli's lead at the top of Serie A.
Rafael Leao opened the scoring after just two minutes, but Fiorentina responded fiercely, finding an equaliser before the half-hour mark through Antonin Barak's deflected effort.
It appeared Milan would have to settle for a share of the points, which would have seen them sit 10 behind Napoli, but a remarkable end saved the hosts.
Milenkovic diverted the ball into his own net to deny Fiorentina in cruel fashion, with their appeals for VAR to intervene being waved away.
The hosts came out of the blocks flying, Olivier Giroud flicking a pass for Leao to charge into the box and slot home into the bottom-right corner with just two minutes on the clock.
Fiorentina had a swift chance to equalise, Riccardo Saponara smashing an effort against the frame of the goal, before pulling level minutes before the half-hour mark as Barak's drive took a wicked deflection off Malick Thiaw to beat Ciprian Tatarusanu.
Milan were back on the front foot at the start of the second period, Giroud forcing a close-range save from Pietro Terracciano and Leao thumping an attempt wide of the post.
At the other end, a superb last-ditch tackle from Fikayo Tomori on Jonathan Ikone kept Fiorentina at bay, with a VAR check confirming no infringement from the England international.
Tomori was again on hand to prevent Ikone, clearing off the line, which proved to be decisive when Milenkovic sent the ball into his own net after Terracciano failed to punch the ball away.