When they were drawn in the same group as Italy, Uruguay and England, teams with seven World Cup titles between them, no one gave the Central Americans a chance of making the second round.
But they did so in style, beating Uruguay 3-1 and Italy 1-0 before strolling to a goalless draw with England to clinch top spot in the group.
They showed gritty determination to battle past Greece in the second round, playing for nearly an hour with 10 men to take the match to a penalty shootout which they won.
Even in their quarter-final defeat by the Netherlands on Saturday, they contained Arjen Robben and Robin van Persie for 120 minutes of open play before finally succumbing to defeat in a penalty shootout in Salvador.
"During this World Cup we have done very beautiful things that many people didn't believe we could achieve - wonderful things," their Colombian coach Jorge Luis Pinto said.
"We played against great powerhouses of football. We leave the tournament unbeaten (in open play). It's incredible."
Costa Rica's achievements are all the more remarkable given the injuries they suffered in the run-up to the tournament.
Their best defender, left back Bryan Oviedo, failed to recover from a broken leg in time to come to Brazil and striker Alvaro Saborio, their top scorer in qualifying, broke a bone in his foot weeks before the tournament started.
Days after arriving in Brazil, right back Heiner Mora broke his heel bone in one of their first training sessions and it promised to be a miserable World Cup.
But from the outset, Pinto's side played with a confidence and maturity that belied their lowly status.
Their main striker, the lightning-quick Joel Campbell, has made most of their headlines and after spending last season on loan in Greece might well have done enough to earn a permanent move to England.
He is currently on Arsenal's books, although Everton and Newcastle are also reportedly interested in signing him.
Campbell has been admirably supported by captain Bryan Ruiz and Christian Bolanos in the attacking midfield roles. The latter's pin-point free kicks and corners have been a feature of Costa Rica's World Cup.
But it is in defense that Pinto's side have really shone. In five matches in Brazil they conceded just two goals in open play and one of them was from a penalty.
Keylor Navas confirmed his reputation as one of the world's best goalkeepers while defenders Giancarlo Gonzalez, Michael Umana and Cristian Gamboa showed themselves equal to the threat of Italy's Mario Balotelli, Uruguay's Edinson Cavani, England's Wayne Rooney and the Dutchmen Van Persie and Robben.
Much of the credit for Costa Rica's fabulous World Cup campaign must go to Pinto, a meticulous coach who prepares for each match as if it were his last.
His website www.jorgeluispinto.com is packed with information and videos outlining tactics and strategies.
Pinto has been in charge of the Costa Ricans since 2011 and is likely to stay on until the 2016 Copa America in the United States.
If the Costa Ricans participate and play anything like they did here, they will give the likes of Brazil, Argentina, Uruguay and Mexico a run for their money.