Carlos Bacca scored twice for AC Milan as Palermo missed out on the chance to go top of Serie A with defeat at the San Siro Stadium.
Palermo forward Oscar Hiljemark also netted twice but could not prevent his side's first defeat of the season.
Bacca flicked Milan in front before Hiljemark headed Palmero level.
A superb Giacomo Bonaventura free-kick restored Milan's lead and after Hiljemark's second goal, Bacca headed Milan's winner three minutes later.
Colombia Bacca, 29, has now scored three goals since his summer signing from Sevilla.
His first goal followed a clever lay-off from Bonaventura before he perfectly glanced home the winner from a Juraj Kucka cross 15 minutes from the end.
Sweden international Hiljemark, 23, has also scored three times for Palermo since signing from PSV Eindhoven in July.
It looked as though his cool finish from an Alberto Gilardino pass had secured a point as he cancelled out a free-kick from Bonaventura just before half-time which saw Palermo coach Giuseppe Iachini sent from the dug-out for disputing the decision.
But Bacca's quick response saw Milan, who used on-loan Liverpool striker Mario Balotelli as a late substitute, successfully bounce back from their derby defeat to Inter in their previous match.
Elsewhere, Massimo Maccarone scored the winner as Empoli secured their first victory of the season at Udinese .
Udinese led through Duvan Zapata's first-half goal but then had Panagiotis Kone sent off for a second yellow card after 72 minutes and Leandro Paredes equalised a minute later.
Maacarone, 36, slotted home in injury time to claim his first goal of the season and complete a 2-1 victory.