Match ends, Milan 3, Palermo 2.
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.
- 20AbateSubstituted forCalabriaat 18'minutes
- 2De Sciglio
- 18MontolivoBooked at 80mins
- 10HondaSubstituted forPoliat 79'minutes
- 9De Souza da SilvaSubstituted forBalotelliat 70'minutes
- 8Fernández Saez
- 33Dias da Costa
- 34de Jong
- 12GonzalezBooked at 66mins
- 34El Kaoutari
- 7LazaarBooked at 45mins
- 10HiljemarkSubstituted forRigoniat 89'minutes
- 99DjurdjevicSubstituted forGilardinoat 56'minutes
- 21QuaisonSubstituted forTrajkovskiat 70'minutes
- 9Cassini de Paula
- Carmine Russo
- Shots on Target
Second Half ends, Milan 3, Palermo 2.
Attempt saved. Mario Balotelli (Milan) right footed shot from outside the box is saved in the bottom left corner. Assisted by Diego López.
Attempt missed. Aleksandar Trajkovski (Palermo) right footed shot from outside the box is too high. Assisted by Franco Vázquez.
Substitution, Palermo. Luca Rigoni replaces Oscar Hiljemark.
Attempt missed. Juraj Kucka (Milan) right footed shot from outside the box misses to the right. Assisted by Cristian Zapata.
Offside, Milan. Juraj Kucka tries a through ball, but Carlos Bacca is caught offside.
Offside, Palermo. Aljaz Struna tries a through ball, but Franco Vázquez is caught offside.
Attempt missed. Aleksandar Trajkovski (Palermo) header from the centre of the box misses to the left. Assisted by Mato Jajalo following a set piece situation.
Riccardo Montolivo (Milan) is shown the yellow card for a bad foul.
Foul by Riccardo Montolivo (Milan).
Franco Vázquez (Palermo) wins a free kick in the attacking half.
Mario Balotelli (Milan) wins a free kick on the left wing.
Foul by Aljaz Struna (Palermo).
Substitution, Milan. Andrea Poli replaces Keisuke Honda.
Attempt missed. Franco Vázquez (Palermo) left footed shot from outside the box is close, but misses to the right. Assisted by Aleksandar Trajkovski.
Attempt saved. Oscar Hiljemark (Palermo) left footed shot from outside the box is saved in the bottom right corner. Assisted by Aleksandar Trajkovski.
Foul by Keisuke Honda (Milan).
Achraf Lazaar (Palermo) wins a free kick on the left wing.
Goal! Milan 3, Palermo 2. Carlos Bacca (Milan) header from the centre of the box to the bottom left corner. Assisted by Juraj Kucka with a cross.