Milan secured successive Serie A wins for only the second time this season as they won 3-2 away to Bologna, who had coach Sinisa Mihajlovic back on the bench for the first time since his bone marrow transplant last month.
Mihajlovic, who was diagnosed with leukemia earlier in the year, received a huge ovation as he walked out pre-match, though his presence was not enough to inspire Bologna to a first league win over Milan since January 2016.
Milan's opening goal will have come as a relief to Krzysztof Piatek as the Poland international scored his first club goal for almost two months from the spot, before Theo Hernandez netted one at either end to put Bologna back in contention.
They were soon trailing by two once again in the second half thanks to Giacomo Bonaventura's sumptuous strike and that proved decisive, giving Bologna too much to do despite Nicola Sansone's late penalty restoring a modicum of hope.
Piatek ended his goal drought from the spot in the 15th minute, converting after being sent tumbling by Bologna defender Mattia Bani.
The hosts failed to mount much of a response and found their task made even trickier just past the half-hour mark, Hernandez beating the goalkeeper from close range after collecting Suso's wonderful disguised pass.
Hernandez found the wrong net late in the half, however, directing a corner past Gianluigi Donnarumma after Stefano Denswil had ducked under the ball.
But any hope of a Bologna comeback was effectively ended within a minute of the second half starting, as Bonaventura curled a fine effort into the left side of the goal from 20 yards.
Sansone's penalty – given after a VAR review – in the 84th minute following Hernandez' clumsy foul on Riccardo Orsolini ensured it was a nervous ending for Milan, but the visitors held on.
What does it mean? Milan move into top half
Talk of a resurgence would certainly be premature despite Milan getting two wins on the bounce, though it is a step in the right direction as they move up to 10th.
With two more matches to come before the mid-season break, Milan will hope they can edge a little closer to the UEFA Europa League spots after New Year.
Bonaventura looked a little more like his old self on Monday (AEDT), as the midfielder was a positive presence in attack and on the ball. He scored a fine goal and completed 91 per cent of his 44 passes.
Mixed day for Hernandez
It was a strange performance from full-back Hernandez. Although he got Milan's second goal, he also put past his own goalkeeper and later conceded a penalty. It is difficult to be complimentary on that basis.
Milan return to the San Siro next Monday as they host Sassuolo. Another tricky test awaits Bologna, who welcome Atalanta on the same day.