Japan edged past Samoa on Thursday night to remain in the hunt for a place in the quarter-finals at the 2023 rugby union World Cup.
They won 28-22 at the Toulouse Stadium and will advance to the last eight for the second consecutive tournament if they beat Argentina on 8 October in Nantes.
Samoa started the Group D clash furiously but Japan opened the scoring in the 13th minute when Pieter Labuschagne touched down following a scrum. Rikiya Matsuda converted to give them a 7-0 lead.
But after trying to push for an immediate try in response, the Samoans accepted the lesser reward of a penalty.
Matsuda responded toAlai Leuila's penalty with one of his own to maintain the seven-point gap at 10-3.
But Japan struck again. A swift, sweeping move from the right sent Michael Leitch over on the left.
Matsuda added the two points and Samoa lost scrum-half Jonathan Taumateine to a yellow card for pushing Dylan Riley out of the way so that he could not collect a pass in the build-up to the try
Hooker Seilala Lam bundled over the line for Samoa just before half-time to male it 17-8 after Japan's Shota Horie was shown a yellow card for a late tackle on Duncan Paia'aua.
Just after the restart, Samoa went down to 14 men again. Ben Lam was sent to the sin bin for 10 minutes for ramming a shoulder into Labuschagne's neck.
While Lam was on the sidelines sweating on whether the card would be upgraded, the Japan skipper Kazuki Himeno scored the try his grit and endeavour had merited. And it was 22-8.
Though he fluffed the conversion, Matsuda added another penalty to push the score to 25-8 just after Sam's yellow was upgraded to red.
With seven minutes remaining But the loss of Lam appeared to galvanize Samoa. Duncan Paia'aua scored and Christian Leali'ifano added the conversion to bring Samoa within 10 points with 15 minutes remaining.
Matsuda kicked another penalty to negotiate some breathing room for his increasingly panicked team rather than trying to score a fourth try to collect a bonus point.
It was a sensible decision.
Samoa scored another try through Leali'ifano who added the conversion to cut the Japanese lead to six points and set up a frantic last two minutes.
The Samoans huffed and puffed but it was not enough.