Flanker Aaron Wainwright (L) scored a try in the first half for Wales

Tokyo (AFP) - Wales scrambled into the Rugby World Cup semi-finals with a nail-biting 20-19 win over 14-man France on Sunday, as Japanese fans prayed for another chapter in the home team’s fairy-tale.

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.

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.

France lock Sebastien Vahaamahina was sent off for elbowing Ross Moriarty in the face

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.

“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.

Later, millions of home fans will tune in for Sunday’s second quarter-final as hosts Japan bid to upset the odds once again against South Africa.

The Brave Blossoms’ run has captured the Japanese imagination, with nearly 55 million watching their scintillating win over Scotland as they topped their pool, organisers said.

Now Japan are hoping they can add to their wins over Ireland and Scotland and topple the mighty Springboks – as they did in their “Miracle of Brighton” victory in 2015, one of rugby’s greatest shocks.

- ‘Play for pride’ -

“We get a lot of support, especially from Japan,” said assistant coach Tony Brown.

“It’s amazing the amount of people that have got on the Japan bandwagon. The amount of people watching every game and supporting us in Japan has been amazing.”

Long queues for replica shirts and endless repeats of Japan’s wins on TV are testament to the growing excitement around the team.

However, they remain heavy underdogs against an imposing South Africa side, who have set out to bully the Japanese with their massive pack and by naming six forwards among their eight replacements on the bench.

“I think I’ll definitely lose if I go head-on,” conceded scrum-half Yutaka Nagare.

“I have to use my technique given I’m small. The try (Finn) Russell scored in the Scotland game started off with my mistake so I really felt responsible, and I feel they’ll look to attack me in the next game, as well as near the try-line.

Millions of Japanese fans will tune in for the quarter-final against South Africa

“But I’ve decided to go in determined to play with pride for this team. I’ll keep my mind strong. I’ll take them on carrying both mind and technique.”

Japan’s ultra-fast, accurate handling and lightning pace created four highlight-reel tries against Scotland as they won 28-21 to reach the quarter-finals for the first time.

South Africa defence coach Jacques Nienaber said it was a “nice challenge” to work out how to nullify the attacking threat of a side crafted by former All Black Jamie Joseph.

“They play a certain style and to their strengths, and they utilise their wings a lot. Their wings won’t typically stay on their sides so the style would incorporate them in attack on both sides -– they both work off their touchlines,” he said.

“But again it does pose weaknesses as well. If you concede turnovers and both your wingers are on one edge, it means you don’t have pace on the other edge.

“So, it does have its benefits. But, like in anything in rugby, for any benefit there is also a counter.”