Switzerland moved through to the World Cup last 16, after a draw over Costa Rica but will be without captain Stephan Lichtsteiner because of suspension.
A 93rd-minute own goal by the unfortunate keeper Yann Sommer from a Bryan Ruiz penalty gave the central American side a deserved 2-2 draw on a night of late drama in Nizhny Novgorod.
That wiped out a Swiss lead which had lasted only two minutes after substitute Josep Drmic slotted home to apparently give the Swiss an undeserved victory.
Earlier Blerim Dzemaili had thumped home in the first half to give Switzerland the lead against the run-of-play in the 31st minute against the team who finished bottom of Group E.
That goal was cancelled out by Kendall Waston's header in the 56th minute, the central Americans first goal of the tournament.
The draw ensured Switzerland finished second in the group behind Brazil.
But Switzerland will be left counting the cost after yellow cards for experienced defenders Lichtsteiner and Fabian Schaer means they will miss the game against Sweden in Saint Petersburg on July 3.
Lichtsteiner received a yellow card for a late tackle on Daniel Colindres in the 37th minute.
It was the Arsenal player's second yellow of the tournament after being booked in the opening game against Brazil.
He was one of three players who had escaped a ban going into the match after the controversial "double eagle" goal celebrations in the fevered 2-1 victory over Serbia.
Then late on Schaer also received his second yellow card of the tournament, also ruling him out of the Sweden match. The point was no more than Costa Rica deserved for a fine performance.
They continually stretched the Swiss defence in the first half and looked the most likely to take all three points in the second.
Switzerland took the lead when Dzemaili emphatically converted from close range after a fine headed knock-down by Breel Embolo.
It was the only goal Switzerland have so far scored in the first-half at the tournament.
The goal was harsh on Costa Rica after a frantic start saw them go close on several occasions, hitting the post and bar.
As early as the sixth minute, Celso Borges' header was brilliantly turned on to the post by Sommer.
Four minutes later Colindres hit the bar with a fine shot which beat the excellent Sommer but hit the bar. Campbell and Oviedo also went close as the Costa Ricans dominated.
But finally, they were rewarded by defender Waston's header from a second-half corner.
The goal ensured that Costa Rica would not be the only team who did not score at this World Cup.