efe-epaYokohama, Japan

An in-form Japan surprised Scotland in the Rugby World Cup on Sunday with a 28-21 win over the visitors to ensure their safe passage to the quarter-finals.

The Scots, on the other hand, were sent packing from the World Cup.

Japan have finished in first spot in Pool A with 19 points, which means they will avoid the dreaded encounter with New Zealand in the next round. The host nation will instead take on South Africa and hope that they can recreate their nail-biting victory over the Spring Bocks back in 2015.

Ireland, who took second spot after losing to Japan, therefore have the unenviable task of trying to dispatch the All Blacks, this year's favorite to win.

It is the first time in the Japan team's history that they have walked away from the group stages with four wins from four and it was watched by a huge home crowd. The official attendance was 67,666.

Scotland opened the scoring in Yokohama with an early try from Finn Russell, converted by Greig Laidlaw.

It was followed by ten minutes of noise from the Japanese fans before Kotaro Matsushima, one of the home side's star talents, put Japan on the scoreboard.

From that point Scotland's defense looked unstable and Keita Inagaki got his second try for Japan in the 25th minute to bring the score to 14-7.

Japan boasted 71 percent of possession in the first 20 minutes.

This domination led to another try just before half time, this time from Kenki Fukuoka with a skillful take on the left-wing to head back to the changing room with 21-7 on the scoreboard.

Fukuoka came racing out the blocks again with an early try in the second half. This prompted a reaction from Scotland and Willem Nel.

The Scots began to match Japan's speed and Zander Ferguson managed a try in the 54th minute to bring the score to 28-21. EFE-EPA