Scotland were sent crashing out of the 2019 Rugby World Cup as hosts Japan won a thrilling Pool A clash to book their place in the quarter-finals in Yokohama.
With so much riding on the match, Scottish Rugby had threatened to sue World Rugby if the match had been postponed in the wake of Typhoon Hagibis wreaking havoc on the country.
A stadium inspection by World Rugby confirmed the game would go ahead as planned but the Scottish were unable to cope with the hosts' high intensity.
Scotland started the match the stronger and made their intentions clear after just six minute when Finn Russell went over for the opening try, Greig Laidlaw adding the extras for a 7-0 lead.
Kotaro Matsushima restored parity on 18 minutes for Japan, who forged ahead with additional first-half tries from Keita Inagaki and Kenki Fukuoka.
A second Fukuoka try three minutes into the second half put Japan 28-7 ahead and Scotland looked down and out.
Gregor Townsend's men did not throw in the towel though and their faint hopes of progression to the last eight were reignited when prop WP Nel found a way through the Japanese line from close range.
Zander Fagerson boosted Scottish hopes further when reducing arrears to 28-21, with Russell duly obliging with the conversion.
Scotland needed another 15 points going into the final 15 minutes, with Japan already four points clear of their rivals in the Pool A table.
Japan remained resolute, though, as they showed signs of the side that won 19-12 against Ireland in the pool's opening match.
The win sees Japan clinch top spot in the pool and sets up a quarter-final match against South Africa next weekend.
Wales won all their group matches at the Wold Cup for the first time since 1987 as they beat against Uruguay 35-13 in Pool D.
In a much-changed line-up, Wales put together an error-strewn first half and led just 7-6 at the break courtesy of prop Nicky Smith's try.
They ran in a further four second half tries though to seal a bonus point victory to top the group.
Josh Adams and Tomos Williams went to ground either side of a penalty try and Gareth Davies completed the try-scoring as Leigh Halfpenny kicked four conversions.
Wales are set to take on France in the quarter-finals.
In Pool C, the already eliminated Tonga won 31-19 against the United States, who finished bottom of the group with four losses from four matches.
Pool winners England are due to take on Australia in the quarter-finals, with New Zealand and Ireland contesting the other last eight match.
Canada's pool B match with Namibia was postponed after landslides and flooding in the Kamaishi area following Typhoon Hagibis.