Hwang Hee-chan scored a stoppage-time winner to beat Portugal 2-1 and put South Korea through to the last 16 of the World Cup at the expense of Uruguay in a dramatic conclusion to Group H.
The Taeguk Warriors appeared to be heading out as they looked set to draw while Uruguay led Ghana elsewhere, but Hwang netted at the end to complete an incredible turnaround.
Ricardo Horta had put Portugal in front early on, but they failed to heed the warning posed by Kim Jin-su's disallowed goal soon after, with Kim Young-gwon deservedly getting South Korea back on level terms.
Portugal – who won the group anyway – coasted through the second half and South Korea took full advantage, with Hwang landing the decisive blow to spark bedlam and send Uruguay packing.
South Korea's feeble start suggested they were there for the taking, with Horta applying an easy finish to take a fifth-minute lead after Diogo Dalot breezed past Kim Jin-su and cut the ball back.
Kim Jin-su scored what he thought was the equaliser 12 minutes later, tapping in on the rebound after Diogo Costa saved Cho Gue-sung's header, but it was ruled out for offside.
Portugal's lead was wiped out before the half-hour, though.
Ronaldo shied away from a corner delivery, which struck him, and Kim Young-gwon was on hand to steer home.
Portugal's captain then missed completely missed his kick from close range early in the second half, the subsequent offside flag doing little to spare his blushes.
A second half generally lacking quality appeared to be petering out.
But then captain Son Heung-min darted towards the Portugal goal, awaited support, and calmly fed Hwang through a defender's legs, Hwang slamming past Costa to secure progress in astonishing fashion.