Ciro Immobile came to Italy's rescue with a late double to cruelly inflict a 3-2 defeat on a plucky Macedonia side in Sunday's 2018 World Cup qualifier in Skopje.
The Azzurri were in control by half-time with Andrea Belotti marking his first Italy start with a maiden international goal to put them 1-0 up in the Group G clash.
But Macedonia, ranked 133 places below Italy, were brilliant after the break and Ilija Nestorovski - who plays his club football in Italy for Palermo - pounced on Marco Verratti's error to level the scores.
Incredibly, the home fans were on their feet celebrating again 142 seconds later when Feran Hasani lashed home from the edge of penalty area.
That left Italy staring down the barrel of a first World Cup or European Championship qualifying defeat in 10 years, but Immobile's cool finish with 15 minutes remaining levelled the scores.
And the Lazio striker salvaged the three points in stoppage time when he headed in Antonio Candreva's cross to break Macedonian hearts.
Giampiero Ventura's men have plenty to ponder, but they now travel to Liechtenstein next month with seven points from three games.
The visitors dominated possession in the early stages, but aside from a Candreva goal that was rightly ruled out for offside they had little to show for their efforts.
Macedonia almost caught Italy cold when Nestorovski hit a stunning volley on the turn from 25 yards that rebounded off the crossbar.
Italy slowly turned the screw, though, and Candreva's deep right-wing cross was hit first-time by Immobile and saved well at the near post by Martin Bogatinov.
And from the resulting corner Italy went in front. Belotti stole a march on his marker to volley home Federico Bernardeschi's delivery from six yards.
Immobile weaved his way into the area and tested Bogatinov at the near post early in the second half, but Macedonia began to cause problems of their own and struck a deserved equaliser in the 57th minute.
Verratti's woeful misplaced pass was pounced upon by Nesterovski, who ran at Leonardo Bonucci before clinically bending his shot into the bottom right-hand corner.
And Macedonia went in front just two minutes later. Bernardeschi was guilty of conceding possession cheaply on this occasion and the hosts launched a lightning counter-attack before Hasani drilled home from the edge of the area.
Veteran goalkeeper Gianluigi Buffon then kept Italy in the game with a superb one-handed save from Besart Ibraimi's header.
And it proved crucial with 15 minutes remaining. Verratti played in Candreva down the right and the Inter winger drilled his cross to Immobile, who calmly picked out the bottom-left corner.
Immobile then saw penalty appeals for handball against Kire Ristevski waved away, while he was also denied a spot-kick when he claimed he was tripped in the area.
Italy had the ball in the net again through Parolo's header in the closing stages, but he was harshly judged offside.
It mattered little, though, as Immobile leapt high at the back post to head in Candreva's floated cross from the right and spare Italy's blushes.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.