In a thrilling 2-1 victory over already-qualified Portugal on Friday, substitute Hwang Hee-chan scored the game-winning goal in stoppage time to save South Korea from World Cup elimination.
At Qatar's Education City Stadium, the Wolverhampton Wanderers forward slipped in the game-winning goal in the 91st minute, sending the Korean supporters into raptures and causing them to cry.
At the sound of the final horn, talisman Son Heung-min, who had set up the winner, fell to the ground and curled up on the turf. His eyes were wet with tears.
The Korean players then waited for their spot in the round of 16 to be confirmed while watching Ghana vs. Uruguay on a mobile device while huddled together on the field.
A much-changed Portugal had taken a fifth-minute lead through Ricardo Horta, but the Koreans, who had to win to stand any chance of staying alive, hit back in the 27th minute through Kim Young-gwon.
Portugal skipper Cristiano Ronaldo played a part in the Korean equaliser, turning his back on a corner and the ball hitting him to set up Kim.
South Korea and their skipper Son, in a mask after recent surgery, needed to score again, but they failed to really trouble Portugal until Son set up Hwang in injury time after a fine run.
Before a ball was even kicked, a roar went up at Education City Stadium every time Ronaldo's face popped up on the big screen, even during the national anthems. There were some jeers and chants of "Messi, Messi."
South Korea coach Paulo Bento, the former Portuguese international, had to watch from the stands after he was sent off following the final whistle of the Koreans' 3-2 defeat to Ghana.
He saw his men fall behind after just five minutes when defender Pepe played the ball down the right to Manchester United full-back Diogo Dalot.
Dalot easily evaded a weak Korean challenge and pulled the ball back from the byline for winger Horta to fire unmarked into the back of the net in front of a 44,000 crowd.
With qualification already secure, Portugal made six changes from the team that beat Uruguay 2-0, Dalot and Horta among those bought in.
But they still looked dangerous every time they went forward in the first half against a Korean defense missing Napoli's Kim Min-jae.
South Korean skipper Son, the Spurs forward, was yet to get going at this World Cup after surgery for a fracture around his left eye at the start of November.
Wearing a black mask to protect the wound, the 30-year-old showed glimpses of his brilliant best as South Korea chased the win they so badly needed.
South Korea were threatening to get on top, and in the 27th minute they were level.
The 37-year-old Ronaldo, surely playing at his last World Cup, unwittingly played a central role in the South Korean goal.
Currently without a club after his bitter departure from Manchester United, the forward turned his back on a Korean corner and the ball hit his shoulder and fell straight to defender Kim to turn in.
The second half was more of the same, with Portugal enjoying more possession and stroking the ball around, but South Korea and an increasingly influential Son posed a threat on the break.
Portugal coach Fernando Santos brought Ronaldo off on 65 minutes to save his legs, then attacker Hwang came on and proved to be the hero at the death.