South Africa ended Japan's dream World Cup run to reach the semi-finals after a bruising 26-3 win against the hosts.
The Springboks led after a powerful run gave Makazole Mapimpi a try, but went a player down when Tendai Mtawarira was shown a yellow card for a tip tackle.
Japan could only take a Yu Tamura penalty from the man advantage, making the score 5-3 at half-time in Tokyo.
Second-half tries from Faf de Klerk and Mapimpi plus Handre Pollard's 11 points put the Springboks out of reach.
The tries put paid to any hopes of a repeat of Japan's 2015 World Cup win against the same opponents and brought to an end a fairytale four weeks for the hosts.
The Springboks will now play Wales in the semi-final on Sunday, 27 October, with the winner facing England or New Zealand in the final.
History made in Tokyo
It was an historic day for Japanese rugby and the fans knew it, posing for photos with South African supporters as proof that they were there.
Television audiences and media interest has gradually increased after an impressive group-stage performance which included superb wins against Ireland and Scotland.
As the hosts qualified for a first World Cup quarter-final, Japanese rugby captured the hearts of the nation and of many fans across the world.
The Brave Blossoms started as optimistically as they had played in the pool stages, with fly-half Yu Tamura kicking cross-field to wing Kotaro Matsushima, but it was two-time winners South Africa who scored first.
The Springboks overpowered Japan in a scrum and De Klerk's pass to Mapimpi found the left wing with plenty of room to run through Tamura and dive over in the corner.
It would take more than that to quieten the Japanese fans, though. Chants of "Japan" were only interrupted when captain Michael Leitch had the ball, at which point prolonged cries of "Leitch" rang out instead.
There was a yellow card for prop Mtawarira for a tip tackle on opposite number Keita Inagaki in the 11th minute.
No tries came of the numerical advantage, but Japan won a scrum penalty just to the left of the posts and the crowd exploded into cheers. Tamura duly landed the kick and cut South Africa's lead to two.
Brave Blossoms overpowered
South Africa coach Rassie Erasmus had stacked his side with strength up front, naming six forwards on the bench.
And when Japan's now trademark fast hands were met with brute force by South Africa, it left the Brave Blossoms looking far less slick in attack than they had in the group stage.
A searing run up the left wing for Kenki Fukuoka brought Japan up to the five-metre line, but the attack came to an end when the hosts conceded a penalty at the breakdown.
Indiscipline was the undoing of South Africa's attack in the first half - the Springboks conceded six penalties to Japan's two in the first 40 minutes.
A disappointing 40 minutes was capped off by a disallowed try for Damian de Allende. The centre clawed his way through four tackles to make it across the try-line but his effort did not count because of a double movement.
However, South Africa were quickly on the scoreboard in the second half thanks to Pollard's first penalty and looked to have extended their lead further when Pieter-Steph du Toit cantered across the whitewash. But that one did not count either because of a forward pass.
Pollard soon added another three points after a scrum penalty and the task facing Japan suddenly looked very daunting at 11-3.
Living up to their name, the Brave Blossoms refused to give in and continued to try and run the ball out from their own 22 at every opportunity.
But a high tackle on De Klerk resulted in a third successful Pollard penalty in front of the posts.
And it was De Klerk who dealt the killer blow. The Sale scrum-half sprung through the hole created in the Japanese defence by a Springbok maul to score and Pollard landed the conversion.
South Africa's attack was repeatedly frustrated by their own indiscipline in the first 40 minutes, but they were well and truly in their stride by the end of the match.
Mapimpi took advantage of an overlap and thundered down the left wing. Japan's Kotaro Matsushima gave chase but was too late to stop the South African scoring his second of the match.
Chants of "Japan" continued right up until the final whistle, when the players fell to their knees and the crowd got to their feet to show their appreciation for what their team had done.
The Japan players formed a circle on the field, tears running down many cheeks, as the Springboks thanked the fans. Hearts were broken in Tokyo, but Japanese fans found their voice to give their team one last roar before they left the pitch.
Teams
Japan: Yamanaka; Matsushima, Lafaele, Nakamura, Fukuoka; Tamura, Nagare; Inagaki, Horie, Koo, Thompson, Moore, Leitch (c), Labuschagne, Himeno.
Replacements:Sakate, Nakajima, Ai Valu, Van der Walt, Lelei Mafi, Tanaka, Matsuda, Lava Lemeki.
South Africa: Le Roux: Kolbe, Am, De Allende, Mapimpi; Pollard, De Klerk, Mtawarira, Mbonambi, Malherbe, Etzebeth, De Jager, Kolisi (c), Du Toit, Vermeulen
Replacements: Marx, Kitschoff, Koch, Snyman, Mostert, Louw, H Jantjies, Steyn