Substitute Alessandro del Piero scored a dramatic late equaliser as Italy earned a 1-1 draw with Mexico - ensuring both teams qualify for the last 16.
With five minutes to go Italy's World Cup hopes were hanging in the balance.
Trailing 1-0 following Jared Borgetti's brilliant first-half header for a slick Mexico side, the three-time winners seemed certain to crash to their second successive defeat.
But Italy - who previously had two goals ruled out for off-side - finally got their equaliser shortly before the final whistle.
Giovanni Trapattoni's team created more than enough chances to score - but at one stage faced joining France and Argentina on the early plane home.
With Italy trailing at half-time and Croatia drawing with Ecuador in the other Group G match, Trapattoni's team faced an early exit.
But Ecuador eventually beat Croatia - meaning that ultimately Italy could have lost to Mexico and still gone through on the goals scored rule.
Italy - knowing they had to win to absolutely guarantee qualification to the last 16 - started the game with playmaker Francesco Totti playing just behind strike duo Christian Vieri and Filippo Inzaghi.
And 13 minutes into the match the Italians thought they had scored.
It's our destiny to be in the second round. And now we can look
to our future
Alessandro del Piero
Totti's sumptuous sliding ball was slotted home by Inzaghi - but the goal was incorrectly ruled out for off-side.
Italy continued to press and create chances.
Vieri shot over and then forced a save from Oscar Perez with an awesome volley, while Totti - clean through after neat work from Inzaghi - missed the target.
But Mexico had played neat, precise football through the opening stages - rarely squandering possession - and were rewarded with a goal after 34 minutes.
Blanco's intelligent floated cross was met by Borgetti, whose exquisitely directed back header eluded Gianluigi Buffon.
Stunned, the Italians pressed forward in search of an equaliser, but mustered little before the break apart from a poor Gianluca Zambrotta shot, while Totti joined Christian Panucci in the referee's notebook for diving.
Mexico, on the other hand, almost scored a second goal minutes before half-time but Borgetti's shot was superbly blocked by Fabio Cannavaro.
Borgetti scored a brilliant header for Mexico
Inzaghi should have equalised four minutes into the second half but his poor first touch allowed Perez to dive at his feet and clear the danger.
Jesus Arrelano's mazy run, cutting inside from the right, almost culminated in a goal but a heavy touch allowed Cannavaro to hook the ball clear.
Substitute Vincenzo Montella put the ball in the net again for Italy - but as with Inzaghi's first-half effort the goal was ruled out for off-side.
The usually prolific Vieri was put through but Perez was quickly off his line and knocked the ball around the post for corner.
Montella blazed over when well positioned after 83 minutes - but eventually Italy got their goal.
Del Piero, who had replaced Totti, headed home Montella's cross to send the Italian supporters into a state of rapture - and keep his team's World Cup dream alive.
Mexico: Perez, Marquez, Vidrio, Carmona, Morales (Garcia 76),
Arellano, Johan Rodriguez (Caballero 75), Luna, Torrado,
Blanco, Borguetti (Palencia 80).
Subs Not Used: Brown, Campos, Gabriel De Anda, Garcia Aspe, Hernandez, Mercado, Alberto Rodriguez, Sanchez, Villa.
Booked: Arellano, Perez.
Italy: Buffon, Panucci (Coco 63), Cannavaro, Nesta, Maldini,
Inzaghi (Montella 56), Zambrotta, Zanetti, Tomi,
Totti (Del Piero 78), Vieri.
Subs Not Used: Abbiati, Delvecchio, Di Biagio, Di Livio, Doni, Gattuso, Iuliano, Materazzi, Toldo.
Booked: Cannavaro, Panucci, Totti, Zambrotta, Montella.
Referee: Carlos Simon (Brazil).
MATCH STATS |
| Mexico | Italy |
Corners (1st half) | 1 | 3 |
Corners (2nd half) | 0 | 5 |
Fouls committed | 14 | 12 |
Caught offside | 1 | 5 |
Shots on target | 2 | 6 |
Shots off target | 6 | 8 |
Hit woodwork (back into play) | 0 | 0 |
Yellow cards | 2 | 5 |
Red cards | 0 | 0 |
STOPPAGE TIME | |
First half - 2 mins | Second half - 4 mins |