AC Milan needed a stoppage-time own goal from defender Nikola Milenkovic to secure a 2-1 Serie A win against Fiorentina at home on Sunday.
The hosts took 90 seconds to take the lead when Olivier Giroud flicked the ball to Rafael Leao, who surged into the box and calmly placed it in the net.
Fiorentina could have equalised after eight minutes when Cristiano Biraghi was played free, but his shot from an acute angle hit the post and bounced out.
Antonin Barak deservedly equalised for Fiorentina after 28 minutes when his shot went in after deflecting off defender Malick Thiaw following scrappy play from Milan inside the box.
One minute into stoppage time, Ante Rebic sent a cross into the box, with Milenkovic miscalculating and directing the ball into his own net.
Milan are second with 33 points as they go into the World Cup break, with third-placed Lazio playing later on Sunday. Fiorentina are 10th with 19 points.