Milan had dozens of chances to win this match, but they ended up losing deep into stoppages in controversial fashion.
Time was running out for the Rossoneri, who had not strung together three consecutive 1-1 Serie A results since 1984. They needed a win in Sicily to keep in touch with the leading pack, but Palermo were still looking for their first home win, having picked up two away victories. Nelson Dida pulled out with a late shoulder injury scare, while Alberto Gilardino and Emerson were given rare starts.
Milan took the lead after 10 minutes with a well-worked team move. Gilardino and Kaka combined with first touch football on the edge of the area for the Brazilian to chip over the defence and Clarence Seedorf stroked home the finish from the penalty spot.
The Rosanero fought back and Zeljko Kalac beat away a fierce Cassani piledriver from distance. Gennaro Gattuso's shot was charged down by Cristian Zaccardo and Gilardino blasted the loose ball over the bar.
Kaka went on one of his trademark runs and Alberto 'Jimmy' Fontana did well to rush out and block his path after the Brazilian had skipped past a couple of defenders.
Seedorf nearly doubled his tally by cracking a curling ball against the crossbar after some great build-up play from Kaka and Gilardino. Kalac smothered a dangerous Miccoli free kick, then the former Perugia starlet failed to make the most of a promising counter-attack.
Fabio Caserta's challenge on Emerson prompted ignored penalty appeals from 'Il Puma'.
The Rossoneri created dozens of chances, but the scoreline remained at 1-0, as Seedorf's angled drive skimmed the far post and Gilardino failed to make the most of a defensive error.
Kakha Kaladze's tough tackle cut short Miccoli's progress, but Milan again went close as Fontana fingertipped Andrea Pirlo's powerful effort on to the crossbar. From the corner Alessandro Nesta's header was denied by a Fabio Simplicio goalline clearance.
Palermo started to push, but on the counter Milan again failed to put the result under lock and key. Seedorf threaded through for Kaka, who went round the goalkeeper and his angled drive was cleared off the line by a back-tracking defender.
They had to pay for such wasteful finishing and on 73 minutes Palermo equalised in controversial circumstances. Amauri chested down the ball - perhaps with help from his left arm - and crossed low for Aimo Diana to come sliding in from six yards.
Pippo Inzaghi replaced Gilardino and his weak looping header was easily smothered, but Massimo Oddo's error in stoppages allowed Amauri to fire over.
Incredibly, Palermo turned it all around to win in the final seconds of injury time! Another Oddo mistake gave away a free kick and Kalac couldn't keep out Miccoli's set-piece after the defensive wall split.