Former Tottenham Hotspur midfielder Giovanni Dos Santos scored a lovely goal in the 48th minute to give Mexico a 1-0 lead in the heat of Fortaleza.
Just when it looked like the Netherlands were going out, Wesley Sneijder equalised in the 88th minute with a powerful strike into the corner from the edge of the area.
Then drama struck again, Arjen Robben was fouled by Mexico captain Rafael Marquez in the penalty area, and Klaas Jan Huntelaar calmly slotted the ball into the bottom corner, to send the dutch into the last eight and leave Mexico heartbroken.
Here are the player ratings for Netherlands:
Jasper Cillessen - 6
Couldn't do anything to stop Dos Santos' goal, looked nervous at times in the first half when coming out of the area.
Stefan De Vrij - 7
Nearly equalised but for an outstanding save from Guillermo Ochoa. Played well in a team that looked to defend from the start.
Ron Vlaar - 6
The Aston Villa defender struggled to cope with the movement of Peralta when the Mexico striker played down the sides of the dutch defence.
Daley Blind - 7
Moved into the defensive midfield role early after De Jong was substituted off, looked composed and accomplished with the ball at his feet.
Paul Verhaegh - 6
Struggled at times when Layun was running with the ball at him in the first half, was susbtituted off after 56 minutes as Van Gaal looked to attack.
Dirk Kuyt - 7
Worked hard for his country, especially at left wing-back that is far from his natural position. Hard working as always from the former Liverpool player.
Nigel De Jong - N/A
Was substituted after nine minutes with an injury.
Georginio Wijnaldum - 6
Didn't get too involved in the match, struggled as the midfielder looked to get himself on the ball and dictate play, but the Dutch were too defensivee to allow him to do that.
Wesley Sneijder - 7
Was criticised after the win over Chile for losing the ball too much, but come good today. Especially his 88th minute equaliser that saved the Dutch from going out.
Robin Van Persie - 7
Didn't make as much of an impact as he would have liked but was left isolated at times up front. Was substituted when 1-0 down after 76 minutes for tactical reasons.
Arjen Robben - 8
Once again, strong and direct running at the heart of Mexico's defence. Isolated Marquez in the second half which Robben comfortably got the better of, 'won' the penalty in the 94th minute.
Bruno Marins Indi - 7
Come on for Nigel De Jong after 9 minutes. Looked to get in the faces of the Mexico attack early on, did well in doing so.
Memphis Depay - 6
Come on for Paul Verhaegh after 56 minutes in an attacking change, looked to come on to his right foot and take shots, none of them were on target.
Klaas Jan Huntelaar - 7
Come on for Robin Van Persie after 76 minutes, had a chance well saved by Ochoa before scoring the 94th minute penalty with ease, considering the pressure.