Emmanuel Gyasi scored a stunning 96th-minute winner as relegation battling Spezia came from behind to beat AC Milan 2-1 in a controversial match at San Siro on Monday, putting a dent in the home side's Serie A title hopes.
Junior Messias thought he had won it for the hosts when he curled home in stoppage time, but the referee's whistle had already sounded for an earlier foul on Milan's Ante Rebic, and Spezia then hit on the break to win it at the death.
The decision left Milan furious as referee Marco Serra left hardly any time for advantage to be played, with around two seconds passing between the foul on Rebic and Messias' shot.
"I tried to calm down the players but couldn't," Milan coach Stefano Pioli told DAZN.
"We know we have suffered an injustice. It's a shame, the responsibility is ours for the goal we conceded but that must be shared with the referee."
It was a missed opportunity for Pioli's side, who went into the game knowing a win would send them top, but remain two points behind leaders Inter Milan, who have a game in hand.
Spezia climbed to 14th place on 22 points, six clear of the relegation zone.
"The guys were great, they knew it was a difficult game against a team that is fighting for the title. We did well right to the end," Spezia coach Thiago Motta said.
Milan went into the game on a run of three consecutive league wins, despite missing a string of key players through injury and Africa Cup of Nations commitments.
But the goalkeeper was at fault when he kicked Leao to concede a spot kick, which Hernandez steered wide.
Within two minutes Leao put them in front, racing onto a long pass to guide a lob over the outrushing Provedel.
Spezia were improved after the break and were rewarded when Agudelo fired home from close range on the 64th minute.
Milan piled forward late on and thought they had won it with Messias' curler but the referee had called a free kick, which Ibrahimovic got on target to force another save from the impressive Provedel.
Spezia struck on the break in the final minute to clinch it, Viktor Kovalenko picking out Gyasi to finish.