Having come a disappointing fourth in their Euro qualifying group, Georgia had to take a circuitous route to Germany, first by winning their group in the less glamorous Euro Nations tournament and then defeating Greece in a play-off.
When those two sides met last September in the qualifying stage for the tournament in Germany, Spain thrashed Georgia 7-1 in Tbilisi.
Georgia's win also means that England will line up against Slovakia, Romania take on Netherlands and Portugal face Slovenia in the round of 16.
But Georgia defended as if their lives depended upon it and sought to catch Portugal on the break.
It is the first time in his long career that he failed to score in the group stage of a major international tournament.
Georgia staged the biggest upset in Euro history with a 2-0 win over Portugal on Wednesday to stride into the knock-out phase of their first major tournament, thanks to an early Khvicha Kvaratskhelia strike and a Georges Mikautadze penalty.
The win, albeit against a largely second-string Portugal who had already made it into the next round, represented the greatest result for Georgia since the country gained independence from the Soviet Union in 1991.
Played out in front of tens of thousands of raucous Georgia fans, it was also the biggest shock based on rankings which put the team rated 74th in the world against Cristiano Ronaldo's Portugal who were ranked sixth and were European champions in 2016.
Having come a disappointing fourth in their Euro qualifying group, Georgia had to take a circuitous route to Germany, first by winning their group in the less glamorous Euro Nations tournament and then defeating Greece in a play-off.
But there was nothing undeserved about the way Coach Willy Sagnol, the former Bayern Munich and France defender, and his side claimed a third-place finish in the tournament's Group F and set up a last-16 meeting with three-time Euro winners Spain.
When those two sides met last September in the qualifying stage for the tournament in Germany, Spain thrashed Georgia 7-1 in Tbilisi.
Georgia's win also means that England will line up against Slovakia, Romania take on Netherlands and Portugal face Slovenia in the round of 16. Hungary, who had been in contention for a spot in the next round, were edged out.
In the other Group F match on Wednesday, Turkey booked their place in the last 16 with a 2-1 win over 10-man Czech Republic, who now head home.
Georgia, the tournament debutants, took the lead in the second minute when Kvaratskhelia, the Napoli winger, raced away after a careless pass by Antonio Silva and powered a low shot past Diogo Costa in Portugal's goal.
Ronaldo — one of only three starters for Portugal who also played in their 3-0 win over Turkey on Saturday — stretched and strained for every ball as he sought to become the oldest goal scorer at a Euro tournament at the age of 39.
But Georgia defended as if their lives depended upon it and sought to catch Portugal on the break. In the 53rd minute, Silva compounded his earlier error by committing a foul in the box that was given as a penalty after a VAR check.
Mikautadze, who had provided the pass for Kvaratskhelia to open the scoring early on, steered his spot kick past Costa, making him the top scorer at Euro 2024 so far with three goals.
Ronaldo was booked in the first half for arguing and cut a frustrated figure when he was substituted after the break, kicking out at a water bottle. It is the first time in his long career that he failed to score in the group stage of a major international tournament.
Georgia goalkeeper Giorgi Mamardashvili made late saves to keep Portugal at bay, and at full time the rest of the squad and coaching staff sprinted on to the field to leap and dance in front of their fans.
The celebrations were fully deserved. Georgia came close to snatching a draw with Turkey but lost 3-1 in their opening game and missed a great chance to beat the Czech Republic a few days later in a 1-1 draw, leaving them perilously close to elimination - until Wednesday's historic night in Gelsenkirchen.