In the sole previous Rugby World Cup encounter between the two, Wales was forced to compete with one man down and wound up losing by one point.

This time, it was its opponent that had the same problem and ended up losing by one point.

Wales came through late and successfully took a lead on a try and successful conversion kick with five minutes left in the match as the Red Dragon edged France 20-19 in the quarterfinals before a crowd of 34,426 at Oita Stadium on Sunday.

With the win, Wales has advanced to the semifinals for the third time, while it has maintaining a perfect record at 5-0. Wales will compete in Yokohama next Sunday night against either South Africa or Japan.

Wales and France squared off against each other in the semifinals of the 2011 tourney in New Zealand. A Welsh player was sent off in the first half and the team fell 9-8 to Le Bleus.

In Sunday's contest, France took the momentum early with quick two tries in the fifth and eighth minutes. Wales erased the deficit to two with a try and a penalty goal, yet France extended its lead to 19-10 on a spectacular try by Virmi Vakatawa in the 31st minute.

The tables were turned in the second half. Minutes into the half, France lost a player when when Sebastien Vahaamahina was shown a red card for elbowing Aaron Wainwright's face during a maul.

A few minutes later, Wales made it down by six with a Dan Biggar penalty goal. France played tenaciously on its defensive end but could not hang on until the final siren.

Wales first-row player Ross Moriarty, who came in as a substitute, managed to put the ball past the goal line for a try after the ball came loose out of a collapsed scrum. Fly-half Dan Bigger slotted a conversion kick to put the reigning Six Nations champion ahead for the first time in the game — and that was the decisive points as well.

France, which virtually outperformed Wales statistically, was not able to score a point in the second half.

"The better team lost today," Wales head coach Warren Gatland said. "And that red card was obviously significant. The thing about our boys, the great thing today, is that they didn't give up. They stick right to the end. They keep working away.

"It was a tough, physical game and France came out of the blocks very well. At halftime, we said we've just got to score next and we did that and stuck in the game, then obviously the red card was a significant moment and then a couple of key guys came on."

Wales veteran captain Alun Wyn Jones said: "The character we showed to come through.... Obviously, there was an advantage in the second half after the card, but we kept plugging away and came away on the right side of the scoreboard."

France head coach Jacques Brunel did not contest the carding for Vahaamahina, adding that it "of course" affected the game, yet still credited his side for its performance.

"Of course, it changed the match," said Brunel, whose team lost 24-19 to Wales in their Six Nations game in February. "In a quarterfinal playing for half the match with 14 men, it is difficult. (But) I want to stress the quality of our team, which showed courage. We had to make up for this, but they had lots of panache and opportunities to score."

France is one of the three teams along with New Zealand and Australia that has advanced to the quarterfinals in all nine World Cups. It had won six times out of the previous eight attempts in the round of eight phase.