Switzerland reached the World Cup knockout phase for the third straight time after prevailing 3-2 over Serbia on Friday to finish runners-up in Group G and set up a last 16 showdown with Portugal.
In a contest that ebbed and flowed at breakneck speed in the first half at Stadium 974, Xherdan Shaqiri put Switzerland ahead but Serbia swiftly scored twice within 10 minutes through Aleksandar Mitrovic and Dusan Vlahovic to flip the game on its head.
Breel Embolo delivered another twist in an absorbing opening period by pulling Switzerland level just before the break, while Remo Freuler scored three minutes after the restart to restore their one-goal advantage again.
"It was a tough game and we battled back bravely," said Gregor Kobel, who deputised for Yann Sommer after the first-choice goalkeeper was ruled out due to illness.
"It was my first international match for some time and to have such an elimination game was something I enjoyed as a challenge. It was certainly not the easiest game. At the end, we are very happy to have won this."
Portugal, like Spain, took their foot off the gas in their final group game, but still finished top.
Kim Young-gwon of South Korea cancelled out Ricardo Horta's fifth-minute strike before Hwang's last-gasp winner.
Finishing top of the group meant Cristiano and Co avoided a possible second-round meeting with Brazil, who will play South Korea.
"We lost our organisation, our focus, and Korea controlled more of the game," said Portugal head coach Fernando Santos.
"Of course our players were motivated, but we conceded a goal when they were on a counter-attack and this can happen at a major tournament.
"We are upset. We finished first of the group, but we wanted to win, and we wanted a better game in order to increase the morale of the players.
"That said, they will not be unmotivated. I trust my team, but this result serves as a warning to them."
When is the match?
The match is on Tuesday December 6.
What time is kick-off?
The match will kick off at the Lusail Stadium at 7pm (GMT), 10pm local time.
What TV channel is it on?
The match will be shown on either BBC or ITV. Telegraph Sport will also be running a live blog on the game - you can bookmark this page now and return on Tuesday to follow along with our coverage.
How have Portugal fared so far?
Portugal opened with a 3-2 victory over Ghana, before securing qualification with a 2-0 win over Uruguay and then losing 2-1 to South Korea.
How have Switzerland got on?
Switzerland begun their campaign in Qatar with a 1-0 win over Cameroon, before losing by the same score to Brazil and finishing off with a 3-2 win over Serbia in a feisty encounter.
Portugal vs Switzerland results history?
Portugal and Switzerland have met each other 25 times, their first meeting in 1938 and their most recent earlier this year in the Uefa Nations League.
The record books show nine wins for Portugal, 11 for Switzerland and five draws.
What is Portugal's World Cup record?
Portugal's have reached the World Cup semi-finals twice - in 1966 and 2006 - but outside of these runs have not advanced past the Round of 16.
Their record at the European Championships is far richer. They won the tournament in 2016, came runners up as hosts in 2004, and have reached the semi-finals three times and quarter-finals twice.
What is Switzerland's World Cup record?
Switzerland have been involved in 12 World Cups - including Qatar - and have reached the Round of 16 in all but on tournament since 2006. Their best runs were to the quarter finals in 1934, 1938, and 1954 - the latter which they hosted.
They've reached the quarter-finals of the European Championships just once, in 2020.
Portugal to win: 4/9
Switzerland to win: 39/19