Japan staged their second stunning turnaround of the World Cup to beat 2010 champions Spain 2-1 on Thursday to surge into the last 16 along with their beaten opponents and dump Germany out in one of the greatest nights for the Samurai Blue.
Japan's turnaround was built on coach Hajime Moriyasu's revamp of his side at the break when they were losing 1-0.
The VAR system took several minutes to confirm the ball had not gone out before Mitoma's touch. Replays suggested that a sliver of the ball had not crossed the line and the verdict sparked wild celebrations similar to the scenes that followed Japan's 2-1 comeback win over Germany last week.
"The players conceded one goal, but they persisted and in very difficult circumstances, they did very well," he told reporters.
Spain had looked in total control in the first half but suddenly they were the ones 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.
Germany won 4-2, a margin of victory that was not big 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 above Japan's defence to power a header past goalkeeper Shuichi Gonda in the 11th minute after a cross by his former Chelsea team mate Cesar Azpilicueta.
In the dying minutes, winger Dani Olmo came closest to a leveller but his angled shot was easily gathered by Gonda.
The breathtaking win for Japan meant they topped Group E, followed by Spain in second who finished ahead of third-placed Germany only on goal difference.
Japan fans were in tears at the end of the match which gives them a chance to go further than they ever have before at a World Cup. Japan have previously reached the last 16 on three occasions and lost each time.
"There were many fans who came all the way from Japan, as well as those that stayed behind in Japan," coach Moriyasu said. "We are gifting this win to the people of Japan and we are very happy about it."
Spain coach Luis Enrique, who made five changes to his starting side to give first-choice players a rest, was far from happy.
"We didn't have any danger in the first half, then in the second half, I told them during halftime to be cautious, because they would attack in the second half, they don't have anything to lose," he said. "I have nothing to celebrate."
Japan defender Kou Itakura was shown his second yellow card of the tournament and will be suspended for the Croatia match.