(CNN) -- Striker Maicon came off to the bench to score twice and help Brazil come from behind to book their place in the Under-20 World Cup semifinals with a 2-1 extra-time victory over Germany in Cairo.
Brazil striker Maicon scored twice against Germany to put his side in the semifinals of the Under-20 World Cup.
After a cagey first half, Germany eventually opened the scoring in the 73rd minute when Lewis Holtby broke the deadlock.
Semih Aydilek put in a perfect cross for Holtby who headed the ball into the net, while under pressure from two Brazilian defenders.
Brazil, though, refused to give up and maintained their pressure and Alex Teixeira had a deflected shot that went just wide before they grabbed an equalizer with two minutes left.
Substitute Maicon latched on to an intelligent through-ball from Alex Teixeira and clinically dispatched a right-footed finish past Germany goalkeeper Ron-Robert Zieler at his near post.
Douglas Costa almost settled the tie in normal time when he rattled the bar in the final minute of added time but Germany held on to force extra-time.
Brazil were now in the ascendancy and in the first minute of extra time they ruthlessly punished an uncharacteristic mistake by the German defense.
A long ball forward was left by German defender Lars Bender who failed to notice the alert Maicon lurking beside him and the Fluminense forward produced an emphatic finish.
Marcos Urena scored in the second minute of time added on at the end of the second period of time added on as his side came from behind to triumph.
Ahmed Khalil set up the 33rd-minute opener for U.A.E. when he burst down the right and squared the ball to Ahmed Ali, who got ahead of David Guzman and put the ball past goalkeeper Esteban Alvarado.
But four minutes later, Josue Martinez powered in a header from Bryan Oviedo's cross.
The U.A.E. should have scored the winner with three minutes left but Ali Mabkhoot, on for the injured goalscorer Ali, hit the sidenetting with only the keeper to beat.
With two minutes to go, Mohamed Fawzi was sent off for a two-footed lunge -- and Costa Rica took full advantage soon after as Urena pounced when keeper Yousif Abdulrahman could only block Allen Guevara's shot following a disastrous backheader by defender Al Kamali.
Los Ticos will be hoping to avoid a repeat of their Group E clash with Brazil, which ended in a 5-0 drubbing.