Fiorentina have snatched an incredible 3-3 draw against Sampdoria after striker German Pezzella scored a dramatic equaliser for his 10-man side deep into added time.
Luis Muriel scored on his debut for Fiorentina in the 34th minute but the hosts had midfielder Edimilson Fernandes sent off for a second bookable offence four minutes later and Gaston Ramirez levelled with a free-kick before half-time.
Despite being a man down, Fiorentina went back in front when Muriel scored with a solo effort in the 79th minute.
Quagliarella, 35, levelled with a penalty in the 81st minute before collecting the ball with his back to goal, slipping between two defenders and scoring with a low shot to take his tally to the season to 14.
But German Pezzella had the last laugh when he levelled for Fiorentina from Federico Chiesa's cross with the last kick of the game, leaving Sampdoria eighth with 30 points and Fiorentina 10th on 27.
In an earlier match, Muriel's fellow Colombia international Duvan Zapata scored four goals to lead Atalanta to a 5-0 win at next-to-bottom Frosinone.
Gianluca Mancini headed seventh-placed Atalanta in front after 11 minutes before Zapata stole the show.
He opened his account with a header just before half-time, struck again on the break two minutes after the re-start and completed his hat-trick with a volley in the 64th minute.
Another header nine minutes later took him level with Serie A joint top scorers Quagliarella and Cristiano Ronaldo on 14 goals.
Bologna extended their winless run in Serie A to 13 games after a 1-1 draw at SPAL.
Rodrigo Palacio curled in from the edge of the area after 24 minutes and Jasmin Kurtic headed SPAL level just after the hour.