Carlos Bacca scored twice as Milan battled to a thrilling 3-2 victory over Palermo in Serie A at San Siro on Saturday.
The Colombia international put the home side ahead with a clever early finish, but Oscar Hiljemark levelled with a header.
A stunning Giacomo Bonaventura free-kick put Milan back in front shortly before the break, but Palermo restored parity against the run of play in the second half through Hiljemark's second goal of the game.
Sinisa Mihajlovic's men were not to be denied, though, with Bacca's thumping header sealing a deserved and vital three points following last week's derby defeat to rivals Inter.
The win means Milan have won two and lost two of their opening four Serie A matches, while the defeat was the visitors' first of the new campaign.
As he promised before the match, Mihajlovic named an unchanged starting XI, meaning Mario Balotelli remained on the substitutes' bench.
Palermo almost scored an own goal with only three minutes on the clock. Luiz Adriano made ground down the right and flashed in a cross that Aljaz Struna diverted at pace towards his own net before Stefano Sorrentino made a reflex save to bail out his team-mate.
Injury forced Milan into an early change, as Ignazio Abate was replaced after failing to shake off the effects of a challenge and Davide Calabria replaced him.
Keisuke Honda shot just over the crossbar after a spectacular piece of skill created the opportunity for himself before the opening goal came for Milan after 21 minutes.
Bonaventura impressively gathered a cross from right and cleverly flicked to Bacca under pressure in the penalty area. The former Sevilla striker made no mistake, sending his first-time finish into the top corner with the outside of his foot.
Palermo had barely threatened in the opening stages, but drew level after 32 minutes. Robin Quaison's corner found Hiljemark, who headed home unchallenged from inside the six-yard box. Milan goalkeeper Diego Lopez appealed for a foul after getting nowhere near the cross, but appeared to have been taken out by his own player, Mattia De Sciglio.
Luiz Adriano almost netted with an instant response when he forced Sorrentino into a save with his legs after showing good strength to muscle into the area and chase his own flick-on. Bacca then forced the away keeper into action again with a cheeky effort.
A second goal appeared to be coming and Bonaventura delivered it in some style five minutes before half-time after he had won a free-kick himself. Stepping up from a prime central position just outside the penalty area, the Milan midfielder converted with a perfect dipping strike.
Shortly after half-time, Bacca fired a powerful effort into the side netting after being found by Calabria.
Palermo brought on ex-Milan striker Alberto Gilardino in a bid to turn their fortunes around before Balotelli made his entrance with 20 minutes remaining, coming on for Luiz Adriano.
The visitors had not mustered another attempt on target other than their goal, but they stunned San Siro on 72 minutes with an equaliser. Gilardino slipped in Hiljemark, who slotted his finish through the legs of Lopez for his second goal of the match.
Rather than feel hard done by, though, Milan replied with the game's decisive fifth goal just three minutes later. Juraj Kucka whipped in a cross from the right and Bacca got up superbly to power a header into the bottom corner from 12 yards.
With the game developing into an end-to-end classic, Hiljemark came close to a hat-trick, but saw his left-footed drive repelled by Lopez's low diving save and Franco Vazquez was inches off target with a shot from distance as the hosts fended off Palermo's late rally.
Elsewhere in Serie A on Saturday, Empoli came from behind to win 2-1 at 10-man Udinese - their first win of the new season. Duvan Zapata had put the hosts ahead, but goals from Leandro Paredes and a stoppage-time strike from veteran Massimo Maccarone sealed the comeback after Panagiotis Kone had been sent off.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.