Wales dug deep to produce a stirring second-half comeback and book their place in the semi-finals of the Rugby World Cup in a nerve-shredding last-eight clash with France in Oita.
A converted Ross Moriarty try seven minutes from time was enough to seal an incident-packed contest in which Wales spent long periods on the back foot.
The game turned on a moment of madness from giant French lock Sebastien Vahaamahina, who was shown red for an elbow into the face of Aaron Wainwright after 49 minutes.
At that time Wales trailed 19-10, but just like they did during the Six Nations opener in Paris in February, Warren Gatland’s men overturned a significant deficit to clinch the win.
Scarlets lock Jake Ball had a colossal game, carrying purposefully throughout, while hooker Ken Owens was at the heart of everything.
Wales were forced into a late change with centre Jonathan Davies withdrawn after aggravating the knee he injured against Fiji and they were rocked by an early French blitz which saw Les Bleus strike for two tries in the opening nine minutes
Vahaamahina ploughed over from close-range, then a break from the dangerous Virimi Vakatawa led to back-rower Charles Ollivon racing unopposed to the posts.
Wales desperately needed some spark and it was provided by Dragons back-rower Wainwright who picked up a loose ball and showed a great turn of pace to outstrip the French defence to gallop to the posts.
Dan Biggar converted and added a penalty to reduce the arrears to just two points, but Wales finished the first half defending for their lives.
The pressure came after replacement Moriarty - on for the injured Josh Navidi - was shown yellow for a high tackle on Gael Fickou.
France made the most of their numerical advantage with a try from the outstanding Vakatawa and it needed some desperate defence to deny Les Bleus another score just before the interval.
Trailing 19-10 at half-time, Wales would have found belief from their second-half comeback at the Stade de France during the Six Nations.
And that would have surged when Vahaamahina was shown red for a reckless elbow into the face of Wainwright as France pressed at a driving maul inside the Wales 22.
Biggar landed a penalty to make it 19-13 on 53 minutes, but French defence continued to frustrate Wales.
George North’s pass, with players free on the outside, was intercepted by Yoaan Huget, then Dillon Lewis knocked on as Wales pushed towards the line in the closing minutes.
But Wales found a way.
With the French scrum in reverse, Tomos Williams stripped the ball clear, Tipuric pounced and Moriarty finished with the close-range touchdown.
It needed the TMO to confirm the score, but Biggar converted to give his side the lead for the first time and Wales were able to hold out to secure their third World Cup semi-final.
Wales - tries: A. Wainwright, R. Moriarty. Cons: D. Biggar (2). Pens: Biggar (2).
France - tries: S. Vahaamahina, C. Ollivon, V. Vakatawa. Cons: R. Ntamack.