Hwang ran onto Son Heung-min's pass in the 91st minute to round off a rapid break and start wild celebrations from his side's fans in the stands.
South Korea had needed to win to stand any chance of joining Portugal in the knockout stage, but even following the final whistle, their progress was not secured.
On the pitch and in the stands, players and supporters watched the final moments of Uruguay's game with Ghana, knowing another goal for the South American side would send them out.
When that 2-0 win was confirmed, a huge roar went around Education City Stadium, and South Korea were able to start the party for real.
Any hope of a happy ending for South Korea had seemed unlikely when they fell behind after only five minutes, with Portugal scoring with their first meaningful attack.
Diogo Dalot surged into the box from the right and from his cutback, Ricardo Horta was in the right place to sweep a first-time shot past Kim Seung-gyu and mark his World Cup debut with a goal.
That made South Korea's task even harder but falling behind failed to silence their thousands of noisy fans and their team soon responded.
The side led by former Portugal player and coach Paulo Bento thought they had replied instantly when Kim Jin-su turned home the rebound after Diogo Costa saved Cho Gue-sung's flicked header. But the celebrations were cut short by a flag for offside.
An equaliser was not long in coming, however, and it followed another cross. This time a corner wasn't cleared and the ball hit Cristiano Ronaldo's back and rolled into the path of Kim Young-gwon, who could hardly miss from close range.
With Uruguay winning against Ghana, South Korea's route out of Group H was open again, but the goals they needed did not look like materialising.
Portugal, now safe as group winners, looked more likely to score, with Vitinha and Horta going close.
Tottenham star Son, so often his nation's hero, seemed to be trying to do too much himself and although he got plenty of power behind two long-range efforts, both were blocked.
At the start of stoppage time, it seemed South Korea were heading out, but they mounted one last attack after clearing a corner and this time Son played the pass instead of shooting himself.
He slipped Wolves forward Hwang clear to run into the area and deliver a cool finish to give this eventful World Cup group stage yet another twist.
South Korea's reward is a tie against the Group G winners, likely to be Brazil, while Portugal will face Switzerland, Cameroon or Serbia.
-- Courtesy of BBC Sport