Japan booked their place in the last 16 of the World Cup after outstanding first-half free-kicks from Keisuke Honda and Yasuhito Endo sent them on their way to victory over Denmark in Rustenburg.
Needing only a draw to qualify from Group E, Japan took the lead in the 17th minute when CSKA Moscow midfielder Honda smashed in a set piece from 30-yards out on the right, though Denmark goalkeeper Thomas Sorensen will feel he could have done much better.
Although not as spectacular, Japan's second goal followed on the half-hour
mark when Sorensen had lined his wall up expecting another Honda effort, only to see his team-mate Endo curl the ball into the bottom corner.
Jon Dahl Tomasson saw his penalty saved nine minutes from the end, but bundled in the rebound to give his side a glimmer of hope, only for Shinji Okazaki to seal Japan's triumph and book a last 16 tie against Paraguay.
The Scandinavians had the first real chance inside five minutes, but Tomasson found himself in the wrong position as he tried to deal with a deflected Simon Poulsen cross and the chance went begging.
Yoshito Okubo then sent in a low cross from the left that was flicked on nicely by Daisuke Matsui 10 yards out, only for Sorensen to intervene outstandingly with his feet. Moments later Makoto Hasebe latched on to a defence-splitting pass, but wastefully shot over.
At the other end captain Tomasson was again played in, on the left side of the box this time, but his low shot curled agonisingly wide. The deadlock was broken the next time Japan went up-field thanks to Honda's stunning free-kick, his second goal so far at the finals.
It came after Matsui was fouled 30-yards out on the right and a curling and dipping shot was sent over the wall into the far corner beyond an outstretched Sorensen.
Tomasson had his third chance inside the opening quarter when Christian Poulsen lifted the ball over the defence, but the Feyenoord front-man failed to connect cleanly and Eiji Kawashima parried the ball away to safety.
Endo then made it 2-0 when he bent his free-kick around the wall into the right-hand corner. After Christian Poulsen tried his luck from distance, Sorensen prevented his side falling further behind before half-time when he tipped over Yuichi Komano's effort from the right.
The Stoke City goalkeeper was saved from embarrassment by his right-hand upright less than three minutes after the restart when he spilt a routine catch from an Endo free-kick.
Kahlenberg then seemed to be taken by surprise when the ball came to him at the back post, guiding the ball wide from a tight angle, while Tomasson was again let down by his control in the six-yard box after Lars Jacobsen swung over a useful cross from the right.
Denmark continued to pile on the pressure and substitute Jakob Poulsen was next to come close, with his long-range effort punched away by Kawashima. Christian Eriksen, another replacement, then saw his strike from outside the box fade away as the Danes looked short of ideas.
When they did manage to get into the penalty area, the out-of-form Tomasson, on a 15-match goal drought before the match, was unable to convert. With 11 minutes to play, another effort from distance by Soren Larsen left the crossbar shaking, but seconds later Tomasson finally managed to hit the back of the net.
After Daniel Agger received a shove in the back to win a penalty, the veteran striker saw his shot stopped by Kawashima, but the rebound was unconvincingly sliced hope.
It gave Denmark hope, but substitute Okazaki killed their spirit in the 87th minute when Honda teed him up beautifully to send Japan through.