AC Milan were headed for defeat at Cagliari until Mario Balotelli's 86th-minute free-kick and Giampaolo Pazzini's last-gasp goal secured victory.
AC Milan pulled off a dramatic late comeback to overturn a 1-0 deficit away to Cagliari and deliver a second Serie A win for new boss Clarence Seedorf.
Seedorf began his coaching career with a hard-fought 1-0 win over Hellas Verona, which brought a wave of optimism to the Rossoneri.
But a mid-week defeat 2-1 to Udinese saw Milan eliminated from the Coppa Italia - their most realistic route to European football next season.
It seemed that the dark clouds were coming back for the Diavolo when they trailed Cagliari 1-0 courtesy of Marco Sau with just four minutes remaining.
Then Mario Balotelli stepped up to curl in a beautiful free-kick from the edge of the box to restore parity.
And as Cagliari reeled, Giampaolo Pazzini, returning from a long-term injury that had kept him out for eight months, netted from a corner to hand Milan an unlikely win.
There's still a lot of work to do if Milan are to haul themselves up from mid-table into contention for a Europa League place, but psychologically this could prove to be a massive win.
Watch Mario Balotelli's sweetly struck free-kick: