Oita - Substitute Ross Moriarty snatched a late winner as Wales floored 14-man France in a breathless Rugby World Cup quarter-final with echoes of 2011 on Sunday.
As it happened | Wales v France
Wales, paced by 10 points from flyhalf Dan Biggar's perfect boot, face South Africa in the semi-finals next weekend after surviving a scare against the swashbuckling French, who led until the 74th minute.
Still haunted by the memory of a stinging 9-8 semi-final loss to France eight years ago, the Six Nations champions looked decidedly uncomfortable until Vahaamahina's rush of blood undid all the hard work the three-time finalists had put in.
Defeat also brought the curtain down on France coach Jacques Brunel's two-year spell in charge before he is replaced by former captain Fabien Galthie.
"I think the better team lost today, but that red card was obviously significant," said Wales coach Warren Gatland, who is also due set to step down after the World Cup.
"But credit to the players -- I'm really proud of the fact they never give up and kept fighting and found a way to win. Other teams would have probably capitulated."
Vahaamahina had stunned the Welsh by bundling over from a lineout after just five minutes before France scored one of the tries of the tournament.
Roared on by chants of "Allez, Les Bleus!" flanker Charles Ollivon stormed through to complete a sweeping move involving Virimi Vakatawa, Romain Ntamack and scrumhalf Antoine Dupont.
Back came Wales in an electrifying opening 12 minutes as flanker Wainwright pounced on a loose ruck on halfway to race clear for his first Test try.
Biggar slotted a penalty to bring the Six Nations champions to within two points.
But when a high tackle from substitute Ross Moriarty on Gael Fickou resulted in a yellow card, France made Wales pay as Damian Penaud released Vakatawa to grab France's third try on the half-hour mark.
French playmaker Ntamack struck the post with a penalty just before the break but the pendulum swung towards Wales after Vahaamahina's rush of blood.
Caught on camera recklessly swinging his elbow flush into Wainwright's face, it was only ever going to result in a red card.
His dismissal came as an ironic twist as then Welsh captain Sam Warburton received an early red card for a dangerous tip tackle on Vincent Clerc in that 2011 semi-final in Auckland.
Wales, who had won seven of their last eight games against France, were still made to work for it in a nail-biting finish.
But just when France looked like holding out for a famous victory, Moriarty popped up after a monster Welsh scrum.
Making up for his earlier indiscretion, the replacement forward bulldozed over six minutes from time before Biggar kicked the conversion that broke French hearts.
"I don't dispute the red card -- he made contact with the player's face," shrugged Brunel, who claimed there was a knock-on in the build-up to Moriarty's decisive try.
"But there were other decisions I didn't agree with -- I'd like to see those images again."
Looking ahead to the semi-finals, Wales captain Alun Wyn Jones said: "The days and weeks feel a little bit longer because of the magnitude of the occasion but we've been to some dark places in preparation for this."
Try: Aaron Wainwright, Ross Moriarty
Conversions: Dan Biggar (2)
Penalties: Bigger (2)
Tries: Sebastien Vahaamahina, Charles Ollivon, Virimi Vakatawa
Conversions: Romain Ntamack (2)
15 Liam Williams, 14 George North, 13 Owen Watkin, 12 Hadleigh Parkes, 11 Josh Adams, 10 Dan Biggar, 9 Gareth Davies, 8 Josh Navidi, 7 Justin Tipuric, 6 Aaron Wainwright, 5 Alun Wyn Jones (captain), 4 Jake Ball, 3 Tomas Francis, 2 Ken Owens, 1 Wyn Jones
Substitutes: 16 Elliot Dee, 17 Rhys Carre, 18 Dillon Lewis, 19 Adam Beard, 20 Ross Moriarty, 21 Tomos Williams, 22 Rhys Patchell, 23 Leigh Halfpenny
15 Maxime Medard, 14 Damian Penaud, 13 Virimi Vakatawa, 12 Gael Fickou, 11 Yoann Huget, 10 Romain Ntamack, 9 Antoine Dupont, 8 Gregory Alldritt, 7 Charles Ollivon, 6 Wenceslas Lauret, 5 Sebastien Vahaamahina, 4 Bernard Le Roux, 3 Rabah Slimani, 2 Guilhem Guirado (captain), 1 Jefferson Poirot
Substitutes: 16 Cyril Baille, 17 Camille Chat, 18 Emerick Setiano, 19 Paul Gabrillagues, 20 Louis Picamoles, 21 Baptiste Serin, 22 Camille Lopez, 23 Vincent Rattez