Japan made history as they reached the quarterfinals of the Rugby World Cup for the first time thanks to a 28-21 defeat of Scotland on Sunday in Yokohama.

The victory sees the Brave Blossoms top Pool A and sets up an intriguing quarterfinal clash with South Africa next Sunday in Tokyo.

"Scotland took it to us from the start and in some parts outplayed us," said coach Jamie Joseph.

"But the tenacity of our team in crucial parts of the test paid dividends. Our persistence, confidence and trust in our game plan saw us through."

(Kenki Fukuoka)

(Kotaro Matsushima)

With so many mathematical permutations as to who would join Ireland in the quarterfinals, Japan made things simple as their explosive, skillful rugby eventually proved too much for Scotland.

A brace of tries from man-of-the-match Kenki Fukuoka, one from Kotaro Matsushima and a first-ever test five pointer from Keita Inagaki eventually saw them home.

But Japan had to withstand a spirited comeback from the men in blue as the crowd of 67,666 at International Stadium Yokohama (Nissan Stadium) were treated to a classic.

"We needed to execute our plan which was to move the ball around from the first half," said scrumhalf Yutaka Nagare. "Scotland showed what they are made of at the end but we've done well."

His opposite number was gracious in defeat.

"First and foremost, credit to Japan because they held the ball really well in the first half and scored some good tries," said Scotland captain Greig Laidlaw. "Give away 28 points to a side like Japan and you're going to be struggling."

"We knew it was going to be a quick game because that's how Japan like to play, so we were trying to keep the ball in. We gave it a good crack in the second half but when you leak 28 points you are always going to be chasing the game."

(Keita Inagaki)

On an emotional night, Scotland started with the advantage of a blustery south-easterly wind, a remnant of Typhoon Hagibis that hit Japan the day before and threatened to cancel the game.

They got off to an ideal start with Finn Russell slipping two tackles to go over in the sixth minute following a period of pressure that had started with his clever cross kick to Darcy Graham.

Japan responded by keeping ball in hand, but were initially up against a tenacious Scottish defense.

A penalty from Yu Tamura in the 16th minute was just beyond the range of the Japan flyhalf.

But a minute later, Fukuoka's break down the blindside and an offload following a good pass from Timothy Lafaele freed up Matsushima, who sprinted over.

Tamura's conversion brought the sides level.

With prop Koo Ji Won forced from the field in the 21st minute, Japan had to adjust. But they instantly won a scrum penalty and a break from Matsushima aided by William Tupou saw Inagaki go over for his first-ever try in a test match.

Japan continued to keep ball in hand and play at pace, and a stunning try from Fukuoka following a brilliant grubber kick from Lafaele saw the teams turn around with the hosts leading 21-7.

The halftime stats said it all with Japan successful in 24-of-28 tackle attempts and Scotland 91 of the 112 they attempted as they tried to contain the rampant Brave Blossoms.

Japan's 21 points were their most ever in the first half of a Rugby World Cup match.

It did not take long for Japan to add a fourth and secure a bonus point as Fukuoka first ripped the ball clean from a Scottish attacker and used his pace to go over.

Scotland pulled a try back through William Nel in the 49th minute, but now needed to beat Japan by more than seven points and score two more tries to deny the hosts a spot in the last eight.

Zander Fagerson caused a few locals to start looking nervously at the clock as he powered over in the 54th minute.

Japan bounced back and looked to have found a second wind, but with the Scottish forwards starting to dominate the breakdowns, Japan were forced to make many more tackles than their opponents.

A scuffle in the 67th minute showed how much things meant to both sides.

It also gave Japan a chance to catch their breath and set themselves up for the final 10 minutes.

"I called the players together and told them we had to stop their momentum," said Japan captain Michael Leitch.

"So we came up with a plan, got the ball back and built our own momentum."

Scotland needed 17 points if they were to eliminate the hosts. But it was beyond them, and the Japan celebrations began just seconds after 80 minutes showed on the clock.

"In those last two or three minutes, the players did not want to lose," said Joseph. "They were playing for all the people that have helped us."