Wales have not played this poorly for the past 18 months but in World Cup knockout games the final scoreline is everything. Warren Gatland’s side are into the last four, 80 minutes away from becoming the first Welsh team to make the final. If they enjoy as much good fortune as they did against France, the Gatland era may yet have a storybook ending.

South Africa to face Wales in semi-final after grinding down hosts Japan Read more

This will certainly go down among the crazier quarter-finals of modern times. With six minutes to go, a 14-man France were threatening to wreck Gatland’s final tournament as the Wales coach, only for a scrambled close-range try from the replacement Ross Moriarty to propel his team into a semi-final against South Africa.

There would almost certainly have been a different outcome had the 49th-minute dismissal of the second-row forward Sébastien Vahaamahina not completely transformed a breathless contest. Nine points ahead and in the middle of an attacking maul within range of the Wales line, the Clermont lock caught the jaw of Aaron Wainwright with a blatant elbow, leaving the referee, Jaco Peyper, no option but to show him a red card. The last time Wales played France in a World Cup knockout match a red card for Sam Warburton proved to be the decisive moment and Gatland was among those to highlight the irony. Before Vahaamahina’s rush of blood, France had been playing some of the most beguiling rugby of the tournament, inspired by their half-backs Romain Ntamack and Antoine Dupont and the pacy duo of Virimi Vakatawa and Damian Penaud. If ever there was a rugby-themed version of beauty and the beast, this was it.

Play Video 1:13 'The better team lost': Warren Gatland relieved after Wales squeeze past France – video

Even Wales’s winning try was contentious, the ball having been ripped from the grasp of the flanker Charles Ollivon by the replacement Wales scrum-half Tomos Williams and appearing to go forward before Justin Tipuric and, finally, Moriarty lunged for the line. After a lengthy debate with the TMO and numerous replays Peyper decided there was no clear evidence that the ball had gone forward from Williams to Tipuric and that Moriarty had touched the ball down legitimately.

It was another high-profile example of the tiny margins that can transform careers. If they go on to win the World Cup, Wales will be tempted to declare 20 October a public holiday and toast Peyper on an annual basis.

France had every right to feel totally gutted. Every now and again they spring gloriously to life at World Cups and here was another example. One glance at a pumped-up Guilhem Guirado squeezing the mascot tight during the anthems was enough to realise Wales, who lost Jonathan Davies to a knee problem on the eve of the game, could expect a proper contest and France had two tries on the board inside the first eight minutes.

Michael Cheika lifts lid on Rugby Australia after quitting as head coach Read more

With Wales still adjusting to the occasion, the giant Vahaamahina rumbled over from close range and a sharp break from Vakatawa was then the catalyst for a second glorious score, the supporting Dupont putting Ollivon away to score. Ntamack’s first conversion attempt had bounced away off a post but he made no mistake with his second to put his side 12-0 in front.

Wales needed to wake up fast and they enjoyed a much-needed boost when Guirado lost possession in contact and Wainwright swooped on the loose ball to race over from fully 40 metres. It was to prove only a temporary reprieve, with France suddenly starting to play like the Barbarians on acid.

Some of their running lines were a joy to behold and with Moriarty in the sin-bin for a high tackle on Gaël Fickou a minute after taking the field, it was no huge surprise when they extended their lead after 31 minutes. Vakatawa, following more neat passing from Ntamack and Penaud, surged over to score France’s third try and further points could easily have materialised shortly afterwards. A lovely arching outside break by Ntamack looked odds-on to bring another try but the scrambling Wales defence somehow survived. There was to be another let-off when Ntamack hit a post again with a penalty and, just before the interval, Wales fans were extremely glad advantage was being played when a long looping pass from Ken Owens was intercepted and Guirado momentarily thought he had scored his side’s fourth try.

Facebook Twitter Pinterest Sebastien Vahaamahina was sent off for a stray elbow on Wales’ Aaron Wainwright. Photograph: ITV Sport

Even the withdrawal of a limping Ntamack at half-time could have been overcome had France opted to take a kickable penalty which could have put them 22‑10 in front. Instead they went for the lineout and the ensuing maul resulted in Vahaamahina’s premature exit. Wales continued to huff and puff, not least when George North had a pass intercepted with two unmarked men outside him. There was a veritable gale of relief when the TMO confirmed Moriarty’s score but they will have to play a lot better to beat the Boks.