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.
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 in the table with 33 points, eight points behind leaders Napoli, as they go into the World Cup break, with third-placed Lazio playing later on Sunday. Fiorentina are 10th with 19 points.
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. Brahim Diaz managed to break free from the Fiorentina defence just before halftime, but while his shot beat Fiorentina keeper Pietro Terracciano, Lorenzo Venuti blocked the attempt almost on the line.
Milan started the second half more aggressively and had a good chance after five minutes when Giroud broke free from his marker inside the box, but keeper Terracciano superbly saved his shot from close range.
Fikayo Tomori prevented a potential Fiorentina goal on the hour mark with a well-timed tackle on Jonathan Ikone inside Milan's own box.
Kone could have secured the win for Fiorentina in the 89th minute, but Tomori saved Milan again by blocking the shot on the goal line, before Milenkovic's error won the game for the hosts.
"A draw would’ve changed the mood going into two months of the break, but we held on somehow with a spirit of sacrifice, without playing frankly that well, but we wanted to win and we did," Milan technical director Paolo Maldini told DAZN.
"Napoli have done some incredible things with 11 wins in a row, so they deserve credit for that. We are more or less where we were last season, except we are also in the Champions League Round of 16 and have a different mentality. That allows us to keep the enthusiasm going even when the performances aren’t very good."