Michael Umana scored the decisive penalty as Costa Rica won the shootout 5-3 after the game ended 1-1 following extra time.
Greece’s Theofanis Gekas saw his penalty saved by Costa Rica goalkeeper Keylor Navas for the only miss in the shootout.
Costa Rica will play the Netherlands in the quarterfinals.
Costa Rica had taken the lead early in the second half through captain Bryan Ruiz but then had defender Oscar Duarte sent off in the 66th minute with a second yellow card for a mistimed tackle on Jose Holebas.
The red card changed the game at Arena Pernambuco and Greece poured forward for most of the remainder of the match.
The Greeks equalized in injury time when defender Sokratis Papastathopoulos smashed in a rebound to finally make the team’s numerical advantage pay.
Greece continued to storm forward in extra time but couldn’t find a way past Navas, who made the victory-clinching save in the shootout after saving his team for most of the match with a succession of last-gasp stops.
The victory delighted the majority of the just over 41,000 fans in Recife as the Brazilian locals shouted for Costa Rica throughout the round-of-16 game.
Netherlands 2, Mexico 1: Klaas Jan Huntelaar and Wesley Sneijder scored late goals Sunday to give Netherlands a spot in the World Cup quarterfinals.
Huntelaar, who came on as a 76th-minute substitute, scored the winning goal from the penalty spot deep in injury time after Rafael Marquez brought down Arjen Robben in the area.
Giovani Dos Santos gave the Mexicans the lead in the 48th minute, but Sneijder equalized for the Dutch in the 88th.
It was the first time Sneijder, who scored five goals at the last World Cup in South Africa, has found the net in Brazil.
Robben has already scored three goals for the Dutch at this year’s tournament, but after earning the late penalty, he handed the ball to Huntelaar.
Huntelaar and Sneijder scored the goals at the hot and steamy Arena Castelao, but it was Netherlands coach Louis van Gaal that may just deserve the credit for making a crucial tactical change during the second of two official cooling breaks.
As he did earlier against Australia, the master tactician again switched his team around in the second half, changing from the more defensive 5-3-2 system to the traditional Dutch attacking 4-3-3 formation.
Van Gaal said he made his critical switch during the second-half break, huddling with his players as they drank from bottles on the sideline.
Ochoa had kept his team in the match with two great saves in the second half, but he was beaten by Sneijder’s powerful drive and guessed wrong when diving in an attempt to stop Huntelaar’s penalty.