A scintillating Cristiano Ronaldo double put Portugal into the European Championship quarter-finals and sent the Netherlands out.
The Dutch needed to win by two clear goals to stand a chance of progressing and Rafael van der Vaart's lovely curling strike put them ahead.
But the Netherlands faded badly and Ronaldo equalised by slotting in from Joao Pereira's precise pass.
Ronaldo drove in a winner and Portugal will next play Czech Republic.
The Dutch, meanwhile, will be left to reflect on a tournament in which they have lost all three of their matches, just two years after finishing as World Cup runners-up.
The Netherlands will first have to get the spectre of Ronaldo out of their minds as the Real Madrid star produced a performance of pace, power and poise to leave them mesmerised.
He was only denied a deserved hat-trick when a thumping late shot came back off the post as the Dutch were outgunned, with coach Bert van Marwijk's tactics backfiring.
Striker Klaas-Jan Huntelaar and playmaker Van der Vaart had started on the bench in the Dutch defeats by Denmark and Germany but both were unleashed from the start this time around.
The pair joined Wesley Sneijder, Arjen Robben and Robin van Persie as Netherlands tried to utilise the attacking prowess at their disposal and, initially, the move paid off.
Van der Vaart took a touch to control Robben's pass before curling in a 20-yard shot past the dive of Portugal goalkeeper Rui Patricio.
But Dutch hopes soon turned into the despair that has followed them around this tournament.
While the Netherlands had an array of potent talent, most of Portugal's reliance up front is on Ronaldo, and he was at his dancing and darting best as the Dutch goal brought his side out of their shell.
Ronaldo bamboozled right-back Gregory van der Wiel as he cut in from the left and struck a shot which clipped the outside of the post.
Van der Wiel must still have been in a daze moments later as his backpass put Helder Postiga through on goal, with his strike being palmed wide by keeper Maarten Stekelenburg.
Confident and creative, Ronaldo was proving a nightmare for a defence left exposed by their attacking tactics.
He had a header beaten away by Stekelenburg before he equalised, timing a run to perfection to collect a defence-splitting Pereira pass before slotting home to become the first Portuguese player to score at five major tournaments.
The former Manchester United man had a dipping 35-yard shot fended away by Stekelenburg and headed another chance wide as his energy and exuberance constantly had the Dutch backtracking.
Portugal supporterd their star with a stubborn defence marshalled by Bruno Alves and Pepe, a hard-working midfield trio of Miguel Veloso, Joao Moutinho and Raul Meireles and the trickery of Nani.
Nani helped set up Portugal's winner when he laid the ball across for Ronaldo to step inside and fire in.
Huntelaar may have claimed he should have been a starter for the Dutch in earlier games but his case was not helped by a virtually non-existent performance.
Van der Vaart and Ronaldo each hit the post with late shots before the referee ended the Dutch misery, while Portugal celebrated reaching the quarter-finals and maintaining a record of never going out in the group stages at the European Championship tournament.