Ante Rebic struck the winner as Milan got the better of Roma in a wild Stadio Olimpico clash to narrow the gap on leaders Inter with a 2-1 victory.
The Serie A title battle might have been all but over if Milan had lost this game, but chances came thick and fast and it was a wonder there were only three goals.
The first was a Franck Kessie penalty in the 43rd minute, but Roma got level early in the second half thanks to Jordan Veretout's fine finish.
Rebic scored a classy winner just before the hour; however, he and Zlatan Ibrahimovic both left the fray with injury concerns, having played their part in trimming Inter's lead to four points.
Ibrahimovic almost scored three times in the opening five minutes, having a powerful shot tipped over by Pau Lopez, another cleared off the line by Federico Fazio, and a backheel trickle wide after he pinched the ball from the feet of the dithering goalkeeper. From the second of those, Fikayo Tomori tucked in the loose ball but was offside.
Milan had the ball in the net for a second time in the ninth minute, Ibrahimovic tapping in Rebic's pass, but again the offside flag was raised. The veteran Swede also headed powerfully over minutes later.
Roma, having posed no threat for the opening 27 minutes, had the ball in the net themselves when Henrikh Mkhitaryan headed in after a corner, but a foul by Gianluca Mancini on Theo Hernandez meant it was ruled out.
Milan were awarded their penalty after a VAR check showed Davide Calabria was caught inches inside the box by Fazio, who stood on the defender's foot. Kessie fired low into the right corner.
Roma drew level in the 50th minute, a delicious strike from Veretout finding the far right corner, and Ibrahimovic, whose threat was diminishing as he battled what looked like a thigh problem, made way for Rafael Leao soon after.
Rebic went from second fiddle to chief orchestrator in attack, and he impressively turned Mancini on the edge of the box before firing across Lopez and into the right corner to restore Milan's lead in the 58th minute.
His game was soon over though, with Rebic complaining about a leg injury as he retreated to the bench, Rade Krunic on in his place.
Mkhitaryan was inches away from making it 2-2 when he fizzed a shot just over, and he was then thwarted by an alert save from Gianluigi Donnarumma.
Krunic saw a 45-yard attempt tipped over by Lopez as Milan, in a helter skelter game, held on for a valuable win on the road.