(CNN) -- Costa Rica sent hosts Egypt crashing out of the Under-20 World Cup, moving into the quarterfinals with a shock 2-0 victory in Cairo on Tuesday night.
Costa Rica's Diego Estrada, left, battles with Hosam Hassan of Egypt in Cairo on Tuesday.
Jose Mena headed a first-half opener and Marcos Urena killed off the tie late on to set up a clash with the winner of Wednesday's last-16 tie between Venezuela and the United Arab Emirates.
Captain Mena powered in a superb diving header in the 21st minute as he met David Guzman's free-kick at the far post against the run of play.
Egypt were frustrated as in the second half substitute Mostafa Galal went close with a header from a corner and Afroto forced a good save from Los Ticos goalkeeper Esteban Alvarado.
However, Diego Estrada set up Urena to smash a superb second goal with just two minutes remaining.
Ghana also reached the last eight, coming from behind to beat South Africa 2-1 in extra-time in Ismailia.
The African champions will next play Korea Republic in Suez on Friday thanks to Dominic Adiyiah's fine 25-yard strike in the ninth minute of the first extra period.
After a goalless first half, Kermit Erasmus broke the deadlock in the 58th minute as he beat the offside trap to gather Sibusiso Khumalo's quick free-kick and round goalkeeper Daniel Agyei.
Andre Ayew equalized eight minutes later when he deflected David Addy's whipped set-piece past South Africa keeper Darren Peet.
Striker Adiyiah put Ghana ahead in the 99th minute as he received a pass from Addy and turned his marker to fire home, and the Amajita held on despite having substitute Agyemang sent off for a second yellow card with seven minutes left.
Hungary upset the Czech Republic in Alexandria, winning 4-3 on penalties after the match finished 2-2 after extra-time.
Substitute Adam Balajti scored the decisive spot-kick after teammate Krisztian Nemeth squandered the chance to settle the tie with the 10th regulation attempt.
Goalkeeper Peter Gulacsi was the Magyars' hero with two saves.
Mate Kiss put Hungary ahead in the 13th minute with a 30-yard stunner, but Jan Vosahlik leveled with a header on 26.
Substitute Michael Rabusic put the Czechs ahead in the second minute of the first period of extra-time, then seven minutes later Vladimir Koman curled in a superb free-kick to set up the shootout.