Oranje are through to the World Cup quarter-finals after a stunning late victory thanks to a strike from Wesley Sneijder and a Klaas-Jan Huntelaar penalty
Leading 1-0 with two minutes remaining in Fortaleza on Sunday, Miguel Herrera's men stood on the verge of reaching the last eight of the tournament for the first time since 1986, having exited in the second round in each of the past five finals.
However, substitute Klaas-Jan Huntelaar played a leading role in turning the game on its head, setting up the equaliser for Wesley Sneijder in the 88th minute before converting a stoppage-time penalty after Rafael Marquez was adjudged to have brought down Arjen Robben.
It meant heartbreak for Mexico, who had taken the lead through Giovani dos Santos' fine strike three minutes after half-time, and for long periods it looked as though the Dutch were wilting in the scorching 38-degree (100 degrees Fahrenheit) temperatures.
But Huntelaar, introduced in the 76th minute to replace Robin van Persie, headed Robben's corner into the path of Sneijder to rifle home.
The Schalke striker then sent Guillermo Ochoa the wrong way from the spot to seal Netherlands' passage to the quarter-finals and ensure Mexico's last 16 curse was extended.
Van Persie returned from a one-match ban and slotted straight back into Louis van Gaal's starting XI. Van Gaal was forced into a change in the ninth minute when Nigel de Jong was replaced by Bruno Martins Indi, although signs of any injury were unclear.
Mexico, who had Carlos Salcido back in place of the suspended Jose Juan Vazquez, had the first sight of goal in the 17th minute when Hector Herrera fired wide of the left-hand post from just inside the area following good work from Oribe Peralta.
Miguel Herrera's men felt they should have had a penalty shortly afterwards, but Ron Vlaar's high foot on Hector Herrera went unpunished by referee Pedro Proenca.
Salcido then tried his luck from 30 yards in the 24th minute, his rasping drive causing Jasper Cillessen to move to his right and parry the ball behind for a corner.
Van Persie had Netherlands' first half-chance three minutes later, bringing down a ball over the top before firing into the side-netting from an acute angle with his weaker right foot.
Following the first of two cooling breaks in which the players took on fluids to combat the searing temperatures, Mexico went close again just before the interval, Dos Santos seeing his effort saved by the legs of Cillessen.
The Dutch were denied a penalty of their own in stoppage time, Robben going down under a challenge from Hector Moreno, but once again the match official waved play on, with the latter carried off on a stretcher following the incident.
Mexico made a flying start to the second period, Dos Santos lashing a bouncing ball into the bottom right-hand corner from 25 yards three minutes after the restart.
Peralta threatened a second eight minutes later, but Cillessen was equal to his curling effort from just outside the box.
Netherlands came close to an equaliser in the 58th minute, but Ochoa made a superb reaction stop from Stefan de Vrij, tipping the ball onto the post after the defender met Robben's corner four yards from goal.
Sneijder then saw his 18-yard strike deflect narrowly over the bar.
Ochoa was called into action again in the 74th minute, rushing from his line to deny Robben as the Bayern Munich man bore down on goal, while Vlaar headed the resulting corner over the bar from six yards.
Then came the late drama.
Robben's corner was headed back into the centre of the area by Huntelaar, and Sneijder met it unchallenged to lash a shot into the bottom corner past a motionless Ochoa.
And deep into the extended injury-time period - brought about due to the essential water breaks during the clash - Robben was again the architect, driving into the area before turning inside Marquez, who clipped the winger with an oustretched foot to concede a penalty which was swept home stylishly by Huntelaar.<
The victory keeps Netherlands' hopes of going one better than in South Africa 2010 alive, while Mexico are cruelly denied a place in the quarter-finals once again, having last gone beyond the last-16 on home soil in 1986.