Substitute Kaoru Mitoma scored twice in the dying minutes as Japan beat Australia 2-0 on Thursday to book their place at a seventh straight World Cup and in doing so also helped Saudi Arabia qualify.
It was a crushing blow for an understrength Socceroos who now face a perilous play-off to keep alive their hopes of making Qatar.
The game in a wet Sydney looked destined for a draw before Mitoma converted from close range on 89 minutes, and then again after a mazy run in injury time to spark joyous celebrations from the visitors.
Victory pushed Japan to the top of Asian Group B qualifying on 21 points, six clear of Australia with only one more game to play.
The Saudis, on 19 points, face China in Sharjah later Thursday but are assured of their place in Qatar courtesy of Japan's win.
Australia now cannot finish higher than third, forcing a play-off against the third-placed team in Asian Group A. The winner will then meet a team from South America for the right to play in Qatar later this year.
Japan started their qualifying campaign with two losses from their first three games, but have now won six in a row.
They headed into the high-stakes clash in front of nearly 42,000 fans at Stadium Australia with a clear edge. Australia's last win over them was in 2009 and Hajime Moriyasu's men claimed a crucial 2-1 victory when the two teams met in October.
Australia were also missing a string of players due to coronavirus impacts or injury, including influential duo Aaron Mooy and Tom Rogic.
But in a boost, coach Graham Arnold returned to the sidelines after seven days in self-isolation after testing positive for coronavirus last week.
He was left frustrated as an energetic Japan started strongly with Liverpool star Takumi Minamino testing Socceroos keeper Mat Ryan inside the first minute.
Conditions were difficult in the rain and it took Australia 11 minutes to work their first shot, with a new-look midfield struggling to click and create chances.
While Japan controlled the tempo, Australia got the ball in the net on 25 minutes, ricocheting off Minamino from a Martin Boyle corner, but it was ruled out for an infringement.
Minamino was everywhere, clattering the post with a header and hitting the crossbar minutes later as the chances piled up.
Australia went close twice early in the second half but they quickly tired as Japan again asserted control and constantly pressed for the winner.
Minamino again went agonisingly close with 11 minutes left and it appeared headed for a draw before the late heroics from Mitoma in only his second international.
Also in Asia, South Korea and Iran have already qualified for Qatar.