YOKOHAMA, Japan -- When Michael Leitch thanked everyone for supporting his team, he meant absolutely everyone in Japan.
When he dedicated the team's unprecedented success to the people suffering in the wake of a deadly typhoon that almost caused this game to be cancelled, he meant it from the heart.
His team got the chance to play the game that would prove it was a worthy World Cup quarterfinalist, and he inspired them to take it bravely with a 28-21 win over Scotland on Sunday night, about 24 hours after the destructive storm made landfall.
Against all odds, Japan finished unbeaten to top Pool A and earn a shot at South Africa next week. And it has form against the two-time champion, after producing the so-called Miracle of Brighton to upset the Springboks in 2015.
"It's a tough time at the moment with the typhoon," Leitch said. "Everyone who is suffering with the typhoon, this game was all for you.
"Today was more than just a game for us."
Japan is into the knockout stage for the first time, fittingly in the first Rugby World Cup staged in Asia.
"I'm incredibly proud. From the very start, we played with our heart," Leitch said. "Today was nothing about skill, it was all about emotion and physicality and we showed that. We are representing Asia, we are representing Japan."
After a stirring comeback, Scotland missed the quarterfinals for only the second time and will go home with its streak of seven wins over Japan ending in a narrow defeat. The result meant Ireland placed second in the group and will play the defending champion All Blacks next week.
Japan won with its pace and width, but also with the resolve in the toughest moments that can come out of adversity. And with raucous, almost unanimous support at a Yokohama Stadium packed with 68,000 people almost entirely wearing red-and-white striped shirts.
Winger Kenki Fukuoka was voted player of the match, creating the first try for fellow speedster Kotaro Matsushima, scoring his own try moments before halftime and touching down again three minutes after the break to secure Japan a four-try bonus point with almost half a game to play.
It was Scotland that ended Japan's hopes of a quarterfinal run four years ago. And the Scots rallied from a 31-0 deficit to draw with England in the Six Nations this year, so there was no counting them out. The Scots threatened legal action if they didn't get the chance to play the game, so they had to back that up with a performance.
"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," Scotland captain Greig Laidlaw said. "Credit to Japan."
It started well for Scotland when flyhalf Finn Russell strolled through some weak defence in the seventh minute, but then Japan responded with three tries.
After spurning a shot and missing a shot at goal, Japan went ball-in-hand.
From halfway, Japan spread the ball left to find both speedsters in space. Fukuoka almost got around his opposite but lost his footing and somehow managed a one-handed offload to Matsushima, who sprinted away to score.
A jinking run from Matsushima was the spark for Japan's second try, with prop Keita Inagaki diving over. Yu Tamura missed another penalty attempt from near the right touchline, but again it resulted in a try another minute later.
After a Scottish 22-meter restart, Japan spread the ball left, where Tim Lafaele grubbered a kick through for Fukuoka to grab one-handed and stumble over to score. Tamura's sideline conversion made it a 14-point margin.
The new half had barely started when Fukuoka stripped the ball from Chris Harris and ran away to extend the lead to 28-7.
That's when Scotland threw caution to the wind. Two tries in six minutes to front-rowers Willem Nel and Zander Fagerson narrowed the gap to seven points and set up a tension-filled last 25 minutes.
Both teams threw everything into attack and, when needed, both teams defended grimly. The Scots repelled 22 phases from Japan before earning a relieving penalty. But Scotland just couldn't crack Japan's defence, either.
Three minutes from fulltime, first-half hero Matsushima accidentally carried the ball back over his line, resulting in a five-yard scrum and giving Scotland a chance to equalize. But the Japanese defended their line, regained possession and expertly wound down the clock.
The game that caused so much angst for organizers was green-lit only on Sunday morning after the stadium was assessed, started with a minute of silence.
That was to pay respects for the dead and injured from overnight. From the national anthems on, the noise didn't stop until well after fulltime. Then the celebrations really got underway when Leitch and co bowed to the crowd.