Argentina will face Wales in the quarter-finals after beating Japan 39-27 in Nantes to finish second in Pool D.
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."
[Tries: Chocobares, Careras 3, Boffelli; Cons: Boffelli 3, Sanchez; Pens: Boffelli, Sanchez] Japan 27
[Tries: Fakatava, Saito, Naikabula; Cons: Matsuda 3; Pen: Matsuda; Drop: Lemeki]
Yellow card: Lappies Labuschagne (Japan – 22’ for head clash)
Japan: 15 Lomano Lemeki; 14 Kotaro Matsushima, 13 Dylan Riley, 12 Ryoto Nakamura, 11 Siosaia Fifita; 10 Rikiya Matsuda, 9 Naoto Saito; 8 Kazuki Himeno (captain), 7 Pieter Labuschagne, 6 Michael Leitch; 5 Amato Fakatava, 4 Jack Cornelsen; 3 Jiwon Gu, 2 Shota Horie, 1 Keita Inagaki
Replacements: 16 Atsushi Sakate, 17 Craig Millar, 18 Asaeli Ai Valu, 19 Warner Dearns, 20 Amanaki Saumaki, 21 Kenta Fukuda, 22 Ryohei Yamanaka, 23 Jone Naikabula
Argentina: 15 Juan Cruz Mallia; 14 Emiliano Boffelli, 13 Lucio Cinti, 12 Santiago Chocobares, 11 Mateo Carreras; 10 Santiago Carreras, 9 Gonzalo Bertranou; 8 Juan Martin Gonzalez, 7 Marcos Kremer, 6 Pablo Matera; 5 Tomas Lavanini, 4 Guido Petti; 3 Francisco Gomez Kodela, 2 Julian Montoya (captain), 1 Thomas Gallo
Replacements: 16 Agustin Creevy, 17 Joel Sclavi, 18 Eduardo Bello, 19 Matias Alemanno, 20 Pedro Rubiolo, 21 Lautaro Bazan, 22 Nicolas Sanchez, 23 Matias Moroni
Referee: Ben O’Keeffe (New Zealand)
Assistant Referees: Paul Williams (New Zealand), James Doleman (New Zealand)
TMO: Brendon Pickerill (New Zealand)