Costa Rica put a huge dent in Japan's hopes of reaching the World Cup last 16 when they rebounded from their 7-0 hammering by Spain to claim a surprise 1-0 victory in Group E on Sunday.
The door was ajar for Japan to seal their place in the knockout round after their historic opening win over Germany on the same day as Costa Rica's collapse.
But Keysher Fuller's curling 81st-minute effort, Costa Rica's first shot on target in the tournament, rocked Japan and put their hopes of progression in peril.
When Fuller's left-footer crept into the top of the net despite Japan keeper Shuichi Gonda's doomed attempt to keep it out, Costa Rica's players and fans erupted in delirium.
There may also have been cheers of relief in the Germany camp because a Japan win would have put them under intense pressure to beat Spain in Sunday's later game.
Japan oddly made five changes to their starting line-up and despite beefing up their attack with substitutions in the second half they were punished for a meek approach against shell-shocked opponents.
They remain second in the group on three points but with their last game being against Spain the odds on them reaching the knockout stage for a fourth time have lengthened considerably.
Costa Rica, written off as whipping boys before kickoff, snapped a seven-match winless run at the World Cup to move to three points and now have a possible route to the last 16.
"The less they believe in us the more they bring it out of us," Fuller said. "We were in pain after the defeat to Spain and now we have weight off our shoulders."
When their manager Luis Fernando Suarez said beforehand that his side were "not dead" he was right, although it was a game that will not live long in the memories of neutral fans.
A first-half of mind-numbing tedium even tested the patience of the drum-banging Japanese fans massed in their blue shirts at one end of the Ahmad bin Ali Stadium.
SNAIL'S PACE
Apart from a burst at the start of the game by Japan, the half was played at snail's pace, although for Costa Rica the lack of goalmouth action was probably welcome seeing as they conceded three times in the opening half-hour against Spain.
Both goalkeepers were redundant and the only incidents that could pass as goalmouth action were a cross by Japan's Ritsu Doan that flashed across the goal and a scooped shot high over the crossbar by Costa Rica forward Joel Campbell.
Japan's coach Hajime Moriyasu took off defender Yuto Nagatomo at halftime and replaced him with attacker Takuma Asano who had been left on the bench despite his winner against Germany.
Immediately after the break Japan looked more lively and Hidemasa Morita finally tested Keylor Navas with a stinging left-foot drive which the Costa Rica keeper turned away.
Kicking towards their fans, Japan seized control and Moriyasu made another attacking change with midfielder Kaoru Mitoma coming on for right back Miki Yamane.
Japan's fans kept up a constant din as their side camped in Costa Rica's half and it seemed a matter of time before their pressure would pay off. Then the game was turned upside down.
A rare Costa Rica raid ended with Fuller gathering the ball on the right of the area and curling a shot with his left foot towards the top corner.
Time froze as Gonda reached up to his right to try to claw the ball out, but he could only help it into the net.
"The next match against Spain will be a very intense game," Moriyasu said. "We need to increase the odds for Japan."
Costa Rica's defender Keysher Fuller (R) scores his team's first goal during the Qatar 2022 World Cup Group E football match between Japan and Costa Rica at the Ahmad Bin Ali Stadium in Al-Rayyan.