DOHA-- Japan staged their second stunning turnaround of the World Cup to beat 2010 champions Spain 2-1 on Thursday with two quick-fire goals and advance to the last 16 along with their beaten opponents, dumping Germany out in the process.
The prospect of an early World Cup exit for Japan was transformed into one of the greatest nights for the Samurai Blue after coach Hajime Moriyasu revamped his side at halftime.
Ritsu Doan, one of the substitutes, hammered in a shot from the edge of the box in the 48th minute which Spain goalkeeper Unai Simon - whose poor clearance had created the danger - could not keep out.
Three minutes later, Ao Tanaka scored from point-blank range after the other halftime sub Kaoru Mitoma cut the ball back from the byline.
The VAR system took several minutes to confirm the ball had not gone out before Mitoma's touch, sparking wild celebrations by the Japan players and their fans similar to the scenes that followed their 2-1 comeback win over Germany last week.
Japan, who have never progressed beyond the first knockout round, will face Croatia in the last 16 and Spain will meet Morocco.
Spain had looked in total control in the first half but were suddenly clinging to their chance of staying in the World Cup as Costa Rica and Germany battled out their own drama in the other Group E match which ended in a 4-2 win for Germany, not enough to keep them in the tournament.
Alvaro Morata had put the Spaniards ahead when he scored his third goal in three games in Qatar, rising high above Japan's defence to power a header past goalkeeper Shuichi Gonda in the 11th minute after a cross by Cesar Azpilicueta.
The breathtaking 2-1 win for Japan - who also beat Germany 2-1 after going behind in their opening match of the tournament - meant they topped Group E, followed by Spain in second who finished ahead of third-placed Germany only on goal difference.