Klaas Jan Huntelaar's injury-time penalty ensured the Netherlands narrowly avoided a shock last-16 exit, as the Oranje scored two goals in the final five minutes to beat Mexico in Fortaleza.
Giovani dos Santos struck for El Tricolor early in the second half with a pinpoint 20-yard strike which nestled into the bottom corner of the net.
But Wesley Sneijder returned the scores to parity in the dying minutes with a thunderbolt of a shot from just inside the area – only the second goal that Mexico had conceded in the tournament.
And after several penalty shouts throughout the game, Arjen Robben finally saw the referee point to the spot two minutes into injury time, and Huntelaar slotted home.
The Netherlands welcomed back captain Robin Van Persie from suspension, while continued to use Dirk Kuyt as a makeshift left-back.
Louis Van Gaal had to turn to his bench early as Nigel de Jong was forced off after just nine minutes, replaced by Bruno Martins Indi.
And it was Mexico who had the best of the early chances, with Hector Herrera sliding a shot past the left post.
Minutes later Mexico should have had a penalty when Ron Vlaar's high boot made contact with Herrera's head as the Mexican stooped to head the ball, but referee Pedro Proença was having none of it.
On the half-hour mark the referee called for the World Cup's first 'cooling break' to allow both sets of players to take onboard liquids in the stifling heat of Fortaleza, which reached 38.8 degrees Celsius.
Mexico were again looking the most likely to score after the mini-break, with dos Santos testing Jasper Cillessen in the Dutch goal.
And on the brink of half-time it was the Dutch who this time had a shout for a penalty when Robben looked to be felled by Hector Moreno in the area.
Dos Santos broke the deadlock three minutes after half-time with a stunning solo goal from 20-yards out, collecting the ball, which sat up nicely, and firing past Cillessen's flailing left hand.
Guillaume Ochoa's point-blank save kept the lead intact ten minutes later, partially gloving and partially heading away Stefan de Vrij's backheel from four yards out.
The goalkeeper's reactions again saved Mexico, using his legs to deny Robben, who skilfully skipped over Rafael Marquez – a similar situation to when the Bayern Munich winger threw himself to the deck in the first half.
And Ochoa put his body on the line once more to deny Huntelaar from seven yards - the Schalke 04 striker prodded the ball towards goal.
But the fairytale was not meant to last, and when Sneijder put his foot through a partially cleared corner in the 88th minute Mexican hearts were broken.
And just four minutes later Robben's theatrics in the penalty area finally resulted in the referee awarding a spot kick- the Dutchman once again felled by Marquez.
Huntelaar made no mistake with the penalty, sliding it into the bottom corner as Ochoa dived the wrong way to send the Netherlands into the quarter-finals.
Netherlands 2
Sneijder 88
Huntelaar 90
Mexico 1
Dos Santos 48
Referee: Pedro Proença
Attendance: 58,817
Netherlands (5-3-2): Cillessen, Verhaegh (Depay 56), Kuyt, Blind, Vlaar, de Vrij, Wijnaldum, de Jong (Martins Indi 9), Sneijder, van Persie (Huntelaar 76), Robben
Subs not used: Janmaat, de Guzmán, Veltman, Kongolo, Clasie, Lens, Fer, Vorm, Krul
Mexico: (5-3-2): Ochoa, Aguilar, Layún, Moreno (Reyes 45), Márquez, Rodríguez, Herrera, Salcido, dos Santos (Aquino 61), Peralta (Hernández 75), Guardado
Subs not used: Corona, Fabián, Jiménez, Pulido, Talavera, Ponce, Brizuela, Peña
![]()