Kotaro Matsushima crossed with the final action of the match to earn Japan a bonus point as they climbed to the top of Pool A with a battling 38-19 win against Samoa on Saturday.
Japan 38-19 Samoa
Japan tries: Lafaele, Kazuki, Fukuoka, Matsushima
Japan conversions: Tamura (3)
Japan penalties: Tamura (4)
Samoa tries: Taefu
Samoa conversions: Taefu
Samoa penalties: Taefu (4)
The World Cup hosts claimed a shock victory over Pool A favourites Ireland last time out, but Samoa put up a good fight in Toyota City and looked like denying the Brave Blossoms the maximum haul until Matsushima touched down with the clock having passed 80 minutes.
Timothy Lafaele, Kazuki Himeno and Kenki Fukuoka also scored for Japan, while Henry Taefu accounted for all of Samoa's points.
The result sends Japan three points clear of Joe Schmidt's men at the summit and ends their opponents' slim hopes of a place in the last eight.
The boot of Yu Tamura fired Japan into a 6-0 lead before Taefu got Samoa on the board from the tee after 10 minutes.
Taefu and Tamura exchanged a further kick apiece before TJ Ioane was sin-binned for a late tackle, reducing Samoa to 14 men for 10 minutes - a fifth yellow card of the tournament for Steve Jackson's side.
Japan capitalised on their numerical advantage as Lafaele touched down following a fantastic run from Matsushima, Tamura adding the extras.
Taefu's third three-pointer saw Samoa go in 16-9 down at the break and he split the posts again early in the second to further reduce the deficit, before Tamura atoned for his first miss of the match by reestablishing Japan's seven-point lead.
Jamie Joseph's men finally gave themselves breathing space with Himeno's try from a driving maul, but Taefu added a converted try to his personal points haul six minutes from time to give his side hope of clinching at least a losing bonus point.
However, Japan pulled clear in the closing minutes, as Fukuoka and Matsushima went over in opposite corners to earn Japan an important bonus point of their own.
Jamie Joseph admitted he was "a little bit relieved" after Japan extended their 100 per cent winning start to the 2019 Rugby World Cup by defeating Samoa at the Toyota Stadium.
oseph said: "I feel very proud and a little bit relieved. The Samoan team played very well - four days after a match (against Scotland), to be able to front up, they should be very proud of that.
"We were a bit frantic in the first half and we couldn't execute exactly what we wanted to do. But the pleasing thing is that after half-time we were back in control.
"We showed incredible belief and worked to the very end. The bench that came on in the second half had a massive impact. That's one of the reasons we were successful."
Japan need to beat Scotland in their final group game in Yokohama next Sunday to guarantee qualification to the quarter-final stage.
Joseph added: "Scotland are a very, very good team, with a lot of experience and a lot of X factor. We saw how clinical they were beating Samoa last week.
"The game (qualification) was always going to come down to the final match if we did our job, and it's building up to be a real ripper. I can't wait, the players can't wait."
Samoa coach Steve Jackson was philosophical after his side's own hopes of reaching the knockout stages were ended.
He said: "Japan were deserved winners. We had opportunities here to really put some pressure on and unfortunately we didn't come out with the win."
They will end their tournament against Ireland next week, and Jackson added: "We've got nothing to lose now, have we? Playing against Ireland - again, what an opportunity for us to beat one of the top teams in the world.
"We'll throw everything at it. We'll rest and recover and have a good look at this game. We've got a week to prepare for Ireland. We're just going to go out there and enjoy it."