AC Milan moved four points behind Serie A leaders Inter Milan by beating Roma.
Franck Kessie put Milan ahead from the penalty spot after Roma's Federico Fazio fouled Davide Calabria.
But Roma's Jordan Veretout equalized with a fine finish from 18 yards out after five minutes of the second half.
However, after striker Zlatan Ibrahimovic went off to protect a groin injury, Milan scored the winner through Ante Rebic's shot on the turn following Alexis Saelemaekers' pass.
Ibrahimovic, 39, has scored 14 Serie A goals this season and had numerous chances to add to that total but had a strike tipped over, another effort cleared off the line, a goal disallowed, he backheeled a chance wide and also headed over.
Roma's ex-Manchester United and Arsenal midfielder Henrikh Mkhitaryan had a goal disallowed and shot wide with only goalkeeper Gianluigi Donnarumma to beat before Veretout made it 1-1, but Milan regained the lead again eight minutes later.
Second-placed Milan had failed to win in their past four games in all competitions and are aiming for their first league title since 2010-11.