Japan's players allowed themselves a moment of satisfaction after beating Scotland to reach the Rugby World Cup quarterfinals for the first time on Sunday, but warned their next opponent, South Africa: "we're not finished yet."

"We're not packing our bags and saying 'that's enough,'" said lock forward Luke Thompson, after the Brave Blossoms had beaten the Scots 28-21 at International Stadium Yokohama to finish the first round on top of Pool A with a perfect record of four wins from four.

"We're going out there next week to beat South Africa. South Africa are a great team but we're going out to beat them and that's our challenge. We'll enjoy tonight and relax, and then tomorrow we'll start working again."

The Brave Blossoms produced another monumental performance to add Scotland to their growing list of Tier-1 scalps, recovering from an early Finn Russell try to head into halftime firmly in control after scores from Kotaro Matsushima, Keita Inagaki and Kenki Fukuoka.

Fukuoka scored another try shortly after the restart to put Japan's place in the knockout round seemingly beyond doubt, before tries from Scotland's WP Nel and Zander Fagerson ensured a nervy second half for the home team.

Japan could still have made it through to the quarterfinals if it had lost the game by a margin of seven points or fewer, but head coach Jamie Joseph saw it as a mark of his players' growing belief that they felt compelled to finish the pool stage with a perfect winning record.

"I do think that the Japanese mentality in this team has changed," said Joseph. "My definition of a mentality is what's natural. What we do every day whether we're playing rugby or we're just waking up and being a good guy. This is the way we think and the way we are.

"I felt that we had to change that so they can get the best out of their rugby. The players understand that if you're going to be a good rugby player, it sort of lives with you and has to be with you all the time. That took a bit of a change, but our boys understand that now and they exercise that every day."

Sunday night's game was played in the shadow of Typhoon Hagibis, which swept through Japan on Saturday night and the early hours of Sunday morning and left at least 35 people dead and 17 missing.

A decision on whether or not the game would go ahead was not taken until 10:30 on Sunday morning, and Japan captain Michael Leitch said the people affected by the typhoon were in the players' thoughts as they took to the field.

"Before the match started, in the team hotel, Jamie touched on it," said Leitch. "And the players already knew from conversations this morning, this game was more than just us. There were a lot of people out there that are suffering from the typhoon.

"First of all, for this game to happen there were a lot of people who did a lot of hard work. There were guys up last night out with sponges, sweeping the ground. We're grateful for the opportunity to play for Japan. And I think we showed that for 80 minutes tonight."

Having beaten Russia, Ireland, Samoa and Scotland in the pool stage, Japan now turns its attention toward its Oct. 20 quarterfinal at Tokyo Stadium against South Africa, which finished second in Pool B behind New Zealand.

South Africa beat Japan 41-7 in Kumagaya, Saitama Prefecture, in a World Cup warmup on Sept. 6, but the prematch buildup is sure to be dominated by the Brave Blossoms' seismic win over the Springboks at the 2015 Rugby World Cup in England.

Thompson, who is appearing in his fourth Rugby World Cup, played in that game in Brighton, but the 38-year-old is aware that his team has lost its element of surprise.

"I don't think we're sneaking under the radar," said Thompson. "We've just beaten two Tier-1 sides and finished top of the pool. We've done some pretty amazing things. We've created a new history for Japan rugby but the tournament's not finished for us. We've got another game.

"They're a massive team and they're super-talented and they're well coached. But we're very well coached and super-fit and well prepared, so it's going to be a great game. Hopefully we can carry on the momentum and, if we play to our potential, who knows what can happen?"

Scotland exits the tournament with a record of two wins and two defeats, having lost its opening game against Ireland before beating Samoa and Russia by a combined score of 105-0.

Head coach Gregor Townsend admitted his team only had itself to blame after giving away two "soft" tries against Japan, but he backed the Brave Blossoms to give South Africa a stern test.

"They're a good side," Townsend said of Japan. "When you play a tournament at home, it's going to bring maybe 10, 20 percent more, just the momentum that creates. The confidence they got from the Ireland game was evident tonight. They'll be a tough team to beat. They now play South Africa, and that will be a tough game for South Africa."