Earlier, Wales scrambled into the semi-finals with a nail-biting 20-19 win over 14-man France which carried strong echoes of their last World Cup meeting in 2011
South Africa broke Japanese hearts with a 26-3 quarter-final victory on Sunday to set up a Rugby World Cup semi-final against Wales, who needed a late try to scrape past 14-man France by a single point.
Japan showed their trademark pace and adventure in a promising first half, but they were worn down by the two-time world champions who scored 21 unanswered points in the second period.
Defeat brought an end to Japan's marvellous run, in which they stunned Ireland and Scotland en route to topping Pool A unbeaten and reaching the quarter-finals for the first time, rising to an all-time high of sixth in the world rankings.
Rugby is far from the most popular sport in Japan, but fans have come out in numbers -- and watched on TV in their millions -- for the first World Cup held in Asia.
🇿🇦 What a match!— Springboks (@Springboks) October 20, 2019
🇯🇵 Arigatōgozaimashita Japan! You guys can be extremely proud of your team! They played with honour and put their bodies on the line for you!#StrongerTogether #RWC2019 #JPNvRSA pic.twitter.com/Pg4XcBmP4v
Sunday's results completed the semi-finals line-up for next weekend, after defending champions New Zealand brushed aside Ireland to go on a collision course with England, who convincingly beat Australia.
There were worrying signs for Japan when wing Makazole Mapimpi brushed off fly-half Yu Tamura's tackle to score in the corner in the third minute.
But fleet-footed Japan, dominating possession, were soon giving South Africa the run-around and Tamura got them on the board at 3-5 down after a surprising scrum penalty against the heavyweight Springboks pack.
Handling errors cost South Africa dear in a frustrating first half but they gradually tightened the screws after the break as Pollard kicked three penalties before Faf de Klerk and Mapimpi delivered late tries.
The Brave Blossoms' run has captured the Japanese imagination, with nearly 55 million watching their scintillating win over Scotland to make it four wins out of four in Pool A.
Earlier, Wales scrambled into the semi-finals with a nail-biting 20-19 win over 14-man France which carried strong echoes of their last World Cup meeting in 2011.
Ross Moriarty's late try clinched it as Wales avenged their 2011 semi-final loss to France with a mirror-image result -- after they also had a man sent off and lost by a point eight years ago.
"I think the better team lost today, but that red card was obviously significant. The great thing about our boys is they don't give up," Wales coach Warren Gatland said.
FT in #RWCOita @WelshRugbyUnion win a compelling and dramatic game by ONE point— Rugby World Cup (@rugbyworldcup) October 20, 2019
A brave and defiant display from @FranceRugby
Wales will face either Japan or South Africa in the Semi-Finals #RWC2019 #WALvFRA #WebbEllisCup pic.twitter.com/rN4i8ZdJkB
Two tries in three minutes got France off to a flying start as Sebastien Vahaamahina and then Charles Ollivon, in glorious style, both crossed inside the first 10 minutes of a helter-skelter first half.
Wales' Aaron Wainwright pounced on a loose ball and Dan Biggar stroked the conversion and then a penalty to make it 12-10, but Virimi Vakatawa dived over after several phases to put France 19-10 up at the break.
But in the 49th minute, Vahaamahina saw red for his elbow to Wainwright's face in a maul -- echoing then Wales captain Sam Warburton's sending-off in the 2011 semi-final, won 9-8 by France.
A Biggar penalty reduced the arrears but France bravely held out until six minutes from time, when Moriarty bundled over and Biggar knocked over the vital conversion to snatch it for the Welsh.
FT: Wales 20-19 France— BBC Rugby Union (@bbcrugbyunion) October 20, 2019
They trailed for almost the entire game, but took the lead when it mattered! Wales through against 14-man France.
Japan or South Africa await for a place in the @rugbyworldcup final!
Live reaction: https://t.co/9GBc10g9c1#bbcrugby #WALvFRA pic.twitter.com/QcNOHUczHg
"It's ironic that the last time we met in a World Cup was very similar in a one-point game as well," said Gatland, who kept his counsel on Vahaamahina's elbow to the jaw of Wainwright.
"I don't think anyone could complain about that -- the officials dealt with it appropriately. Unfortunately that's what rugby is about," he added.