South Korea's Park Ji Sung scored the goal that saw the joint hosts qualify for the second round and knocked Portugal out of the World Cup.
Two reds cards for Joao Pinto and Beto gave Portugal a mountain to climb as Korea won 1-0.
Korea now face Italy in the second round, with runners-up USA playing Mexico despite the Americans losing to Poland in the other Group D game.
This was an unforgettable occasion, with 50,000 red-shirted Koreans singing in unison and cheering every positive move by their side, however small, to the rafters.
The yell which erupted when Park scored midway through the second half must have been heard in Tokyo.
Apart from that, the football was generally forgettable until nine-man Portugal staged a desperate late bid to rescue their tournament, leaving gaping gaps at the back.
In the early exchanges Lee Young Pyo flashed a shot over the bar from distance, then Yoo Sang Chul pulled a low left-footed shot wide of a post from 25 yards.
Portugal 's task was made tougher after Pinto was red-carded for jumping in high on Park Ji Sung in the 27th minute.
Pinto rounded on Argentinian referee Angel Sanchez after being shown the card, and only the intervention of some of his team-mates prevented the incident from becoming nasty.
At one stage Portugal captain Fernando Couto had his hands on the referee's face, though it seemed he was merely trying to calm the situation.
Towards the end of the first half, Luis Figo finally contrived an opportunity for Portugal. His through-ball found Pauleta but he was hopelessly wide of the mark from the edge of the box.
Early in the second half, Seol sent a header from a free-kick six inches past the top corner of the Portuguese goal.
Some excellent build-up play by Ahn Jung Hwan sent Seol scurrying to the byline from where he curled over a cross that Yoo met on the leap, but again couldn't hit the target.
From a Figo corner, Pauleta ducked down to flick a header over his marker and almost over Lee Woon Jae, but the Korea keeper just managed to tip the ball away.
In the 66th minute, Portugal were down to nine men when Beto was cautioned for a late lunge on Lee Young Pyo and, having been booked earlier, was sent off.
Four minutes later, Korea took the lead with a splendid individual goal by Park, a 21-year-old midfielder who plays his club football in Japan.
Park, lurking on the corner of the six-yard box, controlled a 30-yard pass on his chest, hooked the ball over Sergio Conceicao and struck it on the half-volley through Baia's legs to score.
Substitute Nuno Gomes had a wonderful chance to stab home an equaliser from close range, but Lee Woon Jae was able to save.
Baia made three tremendous blocks, from Song Chong Gug, Ahn and Seol, before Sergio Conceicao struck the inside of the post with a scissors-kick with a minute remaining.