Germany were given a major scare before beating Algeria 2-1 on Monday to book a FIFA World Cup quarter-final meeting with France.
After a pulsating 90 minutes in Porto Alegre had ended goalless, Chelsea forward Andre Schurrle - on as a half-time substitute for Mario Gotze - cleverly flicked in Thomas Muller's low cross two minutes into extra-time to give Germany the lead.
Mesut Ozil added a second late on to wrap up victory for Joachim Low's side, before Algeria, who performed admirably throughout, gained a consolation through Abdelmoumene Djabou.
The result meant Algeria were unable to exact revenge for the "Disgrace of Gijon", when West Germany and Austria played out a mutually beneficial 1-0 scoreline that saw both sides through from the group at the expense of Algeria in the 1982 finals in Spain.
With many pointing to that infamous match as motivation for Vahid Halilhodzic's men in the build-up, Algeria flew out of the blocks in the opening 20 minutes, cutting through the German backline on a number of occasions and seeing an Islam Slimani goal disallowed for offside.
The African nation - making their first appearance in the second round - continued to impress, but Germany, who will now face France at the Maracana on Friday, finished the stronger and remain on course to reach the semi-finals of a fourth successive World Cup.
Algeria made a flying start and Manuel Neuer had to make a sliding tackle to deny Slimani an effort on goal from wide on the left in the ninth minute, after the goalkeeper had initially misjudged a charge from his line.
Sofiane Feghouli wasted a good position six minutes later, blazing the ball wildly across goal from the byline with two team-mates better placed.
Slimani converted Faouzi Ghoulam's wonderful cross from the left with a diving header in the 17th minute, but the referee's assistant correctly ruled that the Sporting Lisbon man had strayed offside, before Ghoulam flashed another effort narrowly off target as Algeria continued to dominate.
Germany gradually grew into the game towards the end of the first half, Muller heading wide and Ozil testing Rais M'Bolhi with a dipping effort.
Yet Algeria hit back in the 39th minute, Mehdi Mostefa thumping in a shot from 25 yards which deflected off Jerome Boateng and past the left-hand post with Neuer completely wrong-footed.
M'Bolhi made a superb double stop two minutes later, parrying Toni Kroos' drive away and then springing to his feet to keep out Gotze's rebound.
Germany enjoyed a more assured opening to the second period, Schurrle seeing an effort deflected just wide before Skhodran Mustafi, who replaced Mats Hummels (flu) in defence with Boateng switching to centre-back, headed straight at M'Bolhi from Kroos' delivery.
Philipp Lahm went close in the 55th minute, his curling effort diverted wide by an acrobatic save from M'Bolhi.
As the game wore on the play became stretched and Slimani sent a rasping effort from distance straight into the arms of Neuer 15 minutes from time.
Germany responded strongly and Muller ought to have scored his fifth goal of the tournament shortly afterwards, but his powerful header was beaten away by M'Bolhi.
Muller had another clear chance moments later, stabbing the ball wide after a glorious touch to bring the ball under control, while Bastian Schweinsteiger was unable to seriously trouble M'Bolhi with a weak header from Lahm's chipped pass.
Low's side then struck early in the first extra period, Schurrle adjusting brilliantly to backheel Muller's cross from the left into the net.
Algeria could have levelled through Mostefa, who snatched an effort wide from 10 yards after Germany failed to deal with a corner.
Ozil then made the game safe in the closing stages, lashing high into the net after Schurrle had been denied just in front of the goalline by Essaid Belkalem, although there was one final twist as Djabou converted a right-wing cross at the back post to net a deserved consolation for Algeria.
|Coach: J. Löw|
for M. Götze 46'
for S. Mustafi 70'
for B. Schweinsteiger 109'
|Herrera not surprised by Van Gaal sacking|
|Karius hails Klopp as one of world´s best|
|Cavani: I could move to Atletico|
|Benzema: Deschamps has bowed to racists|
|Rashica and Djimsiti miss out on Albania final squad|
|Perez: Zidane has made history at Madrid|
|Keane makes Ireland´s Euros squad|
|Schneiderlin in for Diarra in France squad|
|Sevilla reject director´s request to leave|
|Austria 2 Malta 1: Arnautovic and Schopf seal warm-up win|
|Republic of Ireland 1 Belarus 2: O´Neill´s side beaten in final Euros warm-up|
|Argentina not pulling out of Copa America - AFA chief|
|Halilovic left out of final Croatia squad|
|Eder included in Italy squad as Jorginho misses out|
|Luxembourg 1 Nigeria 3: Iheanacho strikes again for Super Eagles|
|Stuttgart midfielder Maxim among five cut from Romania´s Euro 2016 squad|
|Buffon: Italy not among Euro 2016 favourites|
|Lucas replaces injured Rafinha in Brazil Copa squad|
|PSG confirm Aurier will face trial after police altercation|
|Rosicky included in final Czech Republic squad for Euro 2016|
|Ireland 1-2 Belarus: O'Neill's men's Euro 2016 preparations take a blow|
|Reus snub ´unbelievably difficult´ - Howedes|
|AFA holding meeting to discuss Copa withdrawal|
|England v Portugal: Santos confident despite Ronaldo absence|
|Isco, Saul out of Spain Euro 2016 squad|
|Florentino Perez touts revamp of Champions League format|
|Hazard headlines Belgium squad for Euro 2016|
|Zinchenko handed Ukraine call-up|
|Morata: Improving on Spain´s Euro feats is impossible|
|Injured duo return to make Hungary Euro 2016 squad|
|Mourinho: I will not be distracted by Guardiola battle|
|Ledley passed fit for Wales Euro 2016 squad|
|Turan, Sahin and Calhanoglu lead Turkey´s Euro 2016 squad|
|Shevchenko tells AC Milan to sign Yarmolenko|
|Rashford, Sturridge make England´s Euro 2016 squad|
|Schweinsteiger set for return to Germany training|
|Pato: I expected more games at Chelsea|
|Real Madrid may go for Pogba - Perez|
|World Cup Qualifying Review: New Zealand march on|
|Carvajal furious at missing Euro 2016|
|Mkhitaryan in no rush to sign Borussia Dortmund renewal|
|Pele to auction off memorabilia|
|Reus left out of Germany´s Euro 2016 squad|
|Blind determined to fight for his place under Mourinho|
|Aulas open to PSG bid for Lacazette|
|Giroud does not understand France booing|
|Four places up for grabs as Del Bosque closes on final Spain squad|
|Messi tax trial begins in Barcelona|
|Hart: England can be surprise package at Euro 2016|
|Ancelotti will not push out Gotze - Khedira|
|Ibrahimovic hints at Malmo return|
|Depay not blaming Van Gaal for his Manchester United struggles|
|Deschamps unhappy with ´unfair´ Giroud boos|
|Juventus adamant no Olympics for Dybala|
|Navas ruled out of Copa America|
|Iniesta: Madrid will be disappointed not to win La Liga|
|Messi on track in recovery|
|Morata: I want to succeed at Madrid, but would consider Premier League|
|Lewandowski headlines expected Poland squad|
|France boss Deschamps ´surprised´ by Cameroon performance|
|Payet: I´m expected to score every free-kick now|
|Bashful Rami admits to mistakes against Cameroon|
|Peseiro to leave Porto|
|France 3 Cameroon 2: Payet stunner snatches victory|
|Laxalt for Rodriguez in Uruguay´s Copa squad|
|Guingamp unveil Kombouare as new head coach|
|Real Madrid confirm Achilles problem for Navas|
|Wilmots´ woes worsen as Belgium lose Lombaerts, Boyata|
|Marotta: Juventus optimistic on Dani Alves deal|
|Berlusconi: I courted Guardiola at Barcelona|
|Berlusconi: Donnarumma not for sale, even for €80m|
|Ginola back at home following heart surgery|
|Departing City boss Pellegrini could quit management|
|Ayestaran prepared to fight to keep Gomes at Valencia|
|Sagna hopes to remain at City under Guardiola|
|France 3-2 Cameroon: Payet nets dramatic late winner for Euro 2016 hosts|
|Roma complete permanent Rudiger deal|
|Senderos left out of final Switzerland squad for Euro 2016|
|AFC Wimbledon 2 Plymouth Argyle 0: Dons reach the third tier|
|Spain v South Korea: Pedro wants goalscoring momentum|
|Reus demands Dortmund transfers|
|Poland v Netherlands: Lewandowski out to make the most of set pieces|
|Low still waiting on Germany fitness news|
|Juanfran promises Champions League success in heartfelt letter to fans|
|Belgium v Finland: Hazard backs squad to cope without Kompany|
|Skriniar joins Skrtel, Hamsik in Slovakia squad|
|Scholl: Gotze and Lewandowski dealings strange|
|Terry: Chelsea must learn from mistakes and fight for trophies again|
|Belgium v Finland: Hazard backs squad to cope without Kompany|
|Injury comeback on track, says Germany´s Khedira|
|Victor Sanchez sacked by Depor|
|Rashford signs Manchester United renewal|
|Sturridge resumes England training|
|Pellegrini rues decision to go public with Guardiola appointment|
|Luxembourg v Nigeria: Yusuf set for latest audition|
|Icardi, Perisic not for sale at any price - Inter|
|Carvajal to miss Euro 2016, replaced by Bellerin|
|Terry certain of Mourinho success at Manchester United|
|Pirlo not bitter towards Conte over Euro 2016 snub|
|Dortmund rule out Sokratis exit amid Atletico Madrid links|
|Barcelona revert to tradition with new kit|
|Robben and Ribery in line for Bayern renewals|
|King backs Wales to ´do a Leicester´ at Euro 2016|
|Deschamps: Zidane´s Champions League win is amazing|
|Pulido rescued by Mexican authorities|
|Alaves secure La Liga promotion|
|Gabriel´s childhood dream becomes a reality|
|Mexico v Chile: Vidal set for return|
|Boateng left ´sad´ after politician´s controversial comments|
|Mooy undecided on future|
|Gotze not concentrated on club future|
|Panama 0 Brazil 2: Jonas breaks goalscoring drought, Gabriel nets on debut|
|Postecoglou pleased with additions ahead of Greece clashes|
|Panama 0-2 Brazil: Jonas breaks goalscoring drought, Gabriel nets on debut|
|Ter Stegen laments ´unlucky´ error in Germany defeat|
|Santos hoping for Portugal improvement ahead of Euro 2016|
|Ronaldo dismisses critics after Champions League win|
|Uruguayan side complete Leicester-style championship win|
|New York City 2 Orlando City 2: Molino salvages late point|
|Colombia 3 Haiti 1: Cuadrado helps Pekerman´s side to win|
|Strachan hits out at wayward passing|
|Conte focusing on positives after Scotland victory|
|Colombia 3-1 Haiti: Cuadrado helps Pekerman's side to win|