The 27-year-old scored in both halves to cancel out a superb Van der Vaart strike to condemn the Dutch to a shock exit and secure a date against Czech Republic on Friday.
Rafael Van der Vaart broke the deadlock early on with a sumptuous curling strike from distance. However, Portugal improved after, and despite squandering a barrage of opportunities, Cristiano Ronaldo would equalize in the 28th minute after a fine assist from Joao Pereira.
With chances at both ends in a competitive second half, the Dutch would come unstuck at the speed of Portuguese breaks, with Ronaldo sealing his double 16 minutes from time to send their opponent crashing to a humiliating exit.
Oranje coach Bert van Marwijk opted for a more attacking lineup, dropping captain Mark van Bommel in favor of Van der Vaart with Klaas-Jan Huntelaar replacing the ineffectual Ibrahim Afellay as the Dutch sought an unlikely qualification. In comparison, Paulo Bento named an unchanged side from the eleven that beat Denmark 3-2 on Wednesday.
After a sustained opening period from the Dutch, who needed two clear goals to stand any chance of progressing, the team was rewarded for its perseverance. Wesley Sneijder fired over the side netting after a good delivery from Gregory Van der Wiel. Nevertheless, the breakthrough would be an early one.
Arjen Robben retained possession on the wing, cutting in before feeding through Van der Vaart. The Tottenham midfielder, from distance, produced a moment of star quality in curling the ball past a beaten Rui Patricio to hand Van Marwijk's men an 11th minute lead.
The setback did much to reinvigorate a Portugal side which offered very little in the opening stages. Cristiano Ronaldo raced through the left wing, turning in Ron Vlaar before smashing a low shot off the post and out.
The Seleccao would again falter in the final third. An error from Van der Wiel allowed Helder Postiga to escape from the defense, but with only Maarten Stekelenburg to beat.
With the attacking tempo raised by both teams, further opportunities were squandered. With Nigel de Jong heading narrowly over the bar, Paulo Bento's side proceeded into a swift counterattack with Stekelenburg producing a fine save from a powerful Ronaldo header, clawing the ball away from the line.
With the Portuguese pressure unrelenting, they finally achieved their equalizer. A poor pass from Jetro Willems relinquished possession towards Joao Pereira who in turn, threaded a delightful through ball towards Ronaldo. The Real Madrid forward subsequently slipped the ball under the goalkeeper to restore parity after 28 minutes and move above Luis Figo in the all-time goals list for his country.
After silencing his critics, Ronaldo then proceeded onto the audacious, with a dipping shot from 40 yards forcing Stekelenburg to punch away hurriedly before heading inches wide from a Joao Moutinho corner just seconds later with the 27 year old enjoying a masterful first half at the Metalist Stadium with the teams locked at 1-1.
The second half was a distinctly cagey affair, with news filtering in of events unfolding in Lviv between Denmark and Germany. The Netherlands was much less involved, being forced to keep the Portuguese attackers at bay. When they did get forward, an opportunistic header from Vlaar would fly well over Rui Patricio's bar.
Chances came at a premium, a stark contrast to what occurred in the first half. Portugal would be denied by the offside flag after an angled shot from Ronaldo was blocked into the path of Postiga, who turned it in before the referee cut celebrations short.
The Dutch were second best again, and were almost made to pay after a swashbuckling counterattack through Ronaldo who teed up Fabio Coentrao, but the defender's strike was well saved by a sprawling Stekelenburg save.
Van Marwijk altered his side, bringing on Afellay in favor of de Jong, but to no such avail. Ronaldo breezed past his marker on the left wing, with Nani inexplicably firing straight at Stekelenburg, who pulled off a stunning save.
Another counter would finally come to fruition, as Nani atoned for his miss, setting up a weighted through ball in towards Ronaldo who turned his marker, and fired into the back of the net to seal a quarterfinal place.
Van der Vaart would later hit the post from distance and Van Persie waste a glaring chance. Ronaldo then wasted a chance for a hat trick, hitting the post as the Netherlands ultimately suffered an untimely elimination from the European Championship
Germany's win against Denmark means that Portugal finishes second in Group B and will face the Czech Republic in the first quarterfinal in Warsaw on Thursday. The Netherlands finished its campaign, losing all three group games.
Follow GOAL.COM USA on