Wesley Sneijder and substitute Klaas-Jan Huntelaar, from the spot, scored at the death as the Netherlands recovered from a goal down to stun Mexico and reach the FIFA World Cup quarter-finals.
The Dutch were heading for their earliest exit since falling at the group stage at Italia '90 until Sneijder rifled in a loose ball following a corner with two minutes remaining. Better was to come deep into added time when Rafael Márquez fouled Arjen Robben on the byline and Huntelaar converted the resulting penalty. Giovani dos Santos had driven the North American team into a 48th-minute lead.
While the Aztecas digest their sixth successive elimination at this juncture, the Oranje can look forward to a quarter-final on Saturday against Costa Rica.
The Netherlands received an early blow when Nigel de Jong went off injured. Mexico seized the initiative. Miguel Layún had already dragged a shot wide by the time he took on Paul Verhaegh for pace and whipped a teasing ball across goal.
A fine move then culminated in Hector Herrera sidestepping Stefan de Vrij and pulling a shot past Jasper Cillessen's right-hand post. If the 2010 runners-up were wilting in the heat they will have been glad of the tournament's first cooling break, after which Dos Santos was thwarted by the outstretched right leg of Cillessen.
The 25-year-old, however, found his range three minutes into the second half when he brought down an errant defensive header outside the penalty area and fired a left-footed shot past the goalkeeper.
The task for the Dutch now was to break down a defence that conceded only once in the group stage, something they would have done but for a stunning save from Guillermo Ochoa, who somehow turned De Vrij's close-range effort from Robben's corner on to the upright.
Ochoa proceeded to frustrate Robben after the winger had glided past Márquez, but he was helpless to stop the hitherto quiet Sneijder's sweetly-hit shot. Huntelaar then kept his cool to send the Netherlands through.