Iceland set up a last 16 clash date with England on Monday as substitute Arnór Ingvi Traustason’s last-gasp winner earned the Euro debutants a famous 2-1 win over Austria.
Ireland scored their own memorable 1-0 win over Italy and Belgium beat Sweden by the same score to both move into the last 16, as the international career of Swedish legend Zlatan Ibrahimović ended in defeat.
The Irish, Belgians, Iceland and Portugal join hosts France, Wales, Germany, Croatia, Italy, Switzerland, England, Poland, Spain, Slovakia, Northern Ireland and Hungary in the last 16.
Ireland will take on hosts France in Lyon on Sunday.
Ronaldo also made a record 17th appearance in the Euros and twice rescued his side from an embarrassing early exit in Lyon as surprise package Hungary ensured their place at the top of group F.
The Real Madrid star had earlier looked to be feeling the pressure when he threw a reporter’s microphone into a lake when approached on a pre-match team walk. However, after disappointing performances against Iceland and Austria, Ronaldo came good just in time to set up a meeting with Croatia in Lens on Saturday.
“It was an insane match," said the three-time World Player of the Year.
“Of course, we wanted to win and qualify in first place, but the main thing is we’re through."
Zoltán Gera smashed Hungary into an early lead before Ronaldo slipped in a pass to Nani to equalise before half-time.
Hungary captain Balázs Dzsudzsák twice threatened to cause a massive upset by sending Ronaldo crashing out early in the second period.
Dzsudzsák’s deflected free-kick put Hungary 2-1 up, but Ronaldo responded with a sumptuous back-heel for his historic goal.
Just five minutes later another deflected Dzsudzsák effort restored Hungary’s lead.
Yet Ronaldo was not to be denied as a towering header moved him to within one goal of Michel Platini’s record mark of nine goals in a Euros finals.
Traustason’s strike at the death ensured Iceland their first ever win in a major finals and second place in the group and a date with England in Nice.
“I’ve always supported England at big international tournaments when we haven’t been playing," said Iceland co-coach Heimir Hallgrímsson.
“It’s a dream come true, but we go into the game to get a result. We believe in our ability."
Jón Daði Böðvarsson swept Iceland into an 18th-minute lead at the Stade de France, with Austria paying dearly for Aleksandar Dragović’s missed first-half penalty.
Substitute Alessandro Schöpf levelled for Austria on the hour, but Traustason’s 94th-minute strike condemned Marcel Koller’s side, highly-fancied to shine before the tournament, to a premature exit.
Robbie Brady’s header five minutes from time sparked wild scenes of celebration in Lille as Ireland ended a much-changed Italy’s 100% record at the tournament to set up an enticing last 16 meeting with Didier Deschamps’ French side.
It was Ireland’s first win over Italy in a competitive match since the 1994 World Cup in the US.
But Martin O’Neill’s men had looked set to be denied by a combination of Italy goalkeeper Salvatore Sirigu and Romanian referee Ovidiu Hațegan.
Sirigu, standing in for Gianluigi Buffon in the Italian goal, made a superb save to deny Daryl Murphy, while Hațegan twice waved away Irish penalty appeals in the first-half.
However, Sirigu was at fault as Brady nipped in ahead of the Paris Saint-Germain goalkeeper to head into an empty net for the winner.
There was no fairytale ending for Ibrahimović after the 34-year-old had already announced before the match that he would retire from international football at the end of the tournament.
Ibrahimović did have the ball in the net midway through the second-half against the star-studded Belgians, but the goal was ruled out for a foul by Marcus Berg in the build-up.
Belgium had a series of chances to kill the game off with Romelu Lukaku particularly profligate.
With six minutes remaining, Radja Nainggolan’s arrowed drive into the far corner ended Swedish hopes to set up a last 16 clash with surprise package Hungary.