Mateo Carreras scored a try hat-trick as Argentina booked a quarter-final against Wales with a thrilling 39-27 victory over Japan in a Pool D shoot-out in Nantes.

Centre Santiago Chocobares gave Argentina the perfect start with a try within 70 seconds, but Japan responded with second-row Amato Fakatava popping up on the wing and collecting his own clever chip to score.

Carreras regained the lead with the Brave Blossoms a man down with Pieter Labuschagne sin-binned, but scrum-half Naoto Saito crossed to reduce their deficit to 15-14 at half-time at Stade de la Beaujoire.

Carreras and Emiliano Boffelli both raced over, but then after replacement Jone Naikabula responded to keep Japan within two points the winger completed his hat-trick to seal the last eight tie with Wales in Marseille on Saturday, 14 October.

Argentina head coach Michael Cheika was a relieved man: "We gave them a few easy entries back into the game, which was unfortunate, but if we can turn that around and get better at that next week, maybe we'll be (in) for a chance [against Wales].

"Now everyone is happy, the crowd is happy, they're into it, they're ripe for the next stage, maybe we can just chill out and go for it, play some good footy and we'll see where the cards fall."

"The resilience of this team and coming back from tough moments is what made the difference here," captain Julian Montoya said, but he was blunt about his team's chances in the quarter-finals: "If we don't improve the things we did wrong today, I don't know if it's going to be enough."

"I'm really proud of all the boys and the effort they put in today and the way they played," Japan captain Kazuki Himeno said. "We’re gutted to not get the results we wanted, but we came this far because of all the fans support. This time, we couldn’t get to the top of Mount Everest to bloom the cherry blossoms, but I believe that Japan rugby will continue to grow."

Jamie Joseph, after his last game as Japan head coach, said: "I guess as a coach you can't ask for much more. My boys gave everything, they are behind me breaking down crying. We conceded some soft tries, that's the hurting part but it will go away with time.

"In really tough and difficult circumstances, they've been able to get from the 2019 World Cup to a stage where they can be proud of of this World Cup."