Cristiano Ronaldo scored two trademark brilliant goals Wednesday to go into European Championship history and rescue Portugal in a 3-3 draw with Hungary that took them into the last 16.
The 31-year-old opened his account in style with a deft backheel flick on 50 minutes, then a bullet header 12 minutes later to twice equalise at the Stade de Lyon.
The result left Hungary on top of Group F. Portugal squeezed through as one of the best third-place finishers but now face a tough match against Croatia.
The Real Madrid ace became the first player to score at four European championship finals and his 17th match in a Euro tournament was also a record.
It was his 128th appearance for Portugal, further extending the record he set last Saturday, as he made a record 17th appearance at Euro finals.
Following their draws with Iceland and Austria, Portugal's captain had been feeling the pressure.
He threw a TV reporter's microphone in a lake on the morning of the game in Lyon.
But he delivered when it mattered as Portugal equalised three times in a topsy-turvy match -- not one for the faint-hearted.
Hungary captain Balazs Dzsudzsak matched Ronaldo by netting two second-half goals as the Mighty Magyars took first place in Group F winners.
With three draws, Portugal advance as third behind Iceland.
Hungary took the lead in sweltering conditions at the Stade de Lyon when veteran midfielder Zoltan Gera unleashed a thunderbolt.
There was nothing on when Portugal fail to clear a corner.
But the 37-year-old Gera belted a low left-footed drive into the bottom-right corner which gave Portugal goalkeeper Rui Patricio no chance on 19 minutes.
At the other end, a save from Hungary goalkeeper Gabor Kiraly, who has made grey sweatpants the must-have fashion back home, saved a swirling Ronaldo free-kick on 29 minutes.
Nani had the ball in the Hungary net five minutes from the break, but his effort was ruled offside.
The Fenerbahce forward was not to be denied and his crisp finish, after a lovely pass in from Ronaldo, put Portugal level on 42 minutes.
The game burst into life with four goals in the opening 20 minutes of the second-half.
Hungary regained the lead just two minutes after the break when Dzsudzsak's well-struck free-kick took a slight deflection off the Portugal wall on 47 minutes.
The stage was set for Ronaldo.
The Real superstar made sure he would leave the Stade de Lyon with two records when he flicked his shot past Kiraly on 50 minutes to make it 2-2.
But Portugal's second equaliser only served to galvanise Hungary's resolve.
Dzsudzsak drilled a free-kick off the wall, but pounced on the rebound and his left-footed shot deflected off Nani, past Rui Patricio, into the far corner on 55 minutes for a 3-2 lead.
There was, however, no denying Ronaldo.
Just moments after coming on, Ricardo Queresma fired in a corner and Ronaldo drove his header past Kiraly on 62 minutes.
By now it was end-to-end stuff as Hungary's attacking midfielder Akos Elek hit the woodwork on 64 minutes as it stayed 3-3 at the final whistle.