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'
|ES Setif v AS Vita Club: Algerians aiming to prove doubters wrong|
|Cavani unsure over Paris Saint-Germain future|
|Melbourne City 1 Adelaide United 2: Villa bows out with defeat|
|Robertson returns for Hull|
|Di Matteo calls the shots - Heldt|
|Reveillere counting on European experience|
|Cheyrou leaves Marseille|
|Allardyce considers mid-season break|
|Cavani working to prove critics wrong|
|Walcott not ready to start, Wilshere ruled out against Burnley|
|Vermes refuses to play blame game|
|Eto´o on course to trigger Everton extension|
|Pellegrini facing sack - Marsh|
|Guidetti must pick Celtic - Deila|
|Zubizarreta unconcerned by Barcelona´s squad age|
|Costa Rican Primera Division Review: Alajuelense preserve lead|
|Al Hilal v Western Sydney Wanderers: A clash of styles to decide Asian champions|
|Liverpool exit possible - Gerrard|
|Pioli pleased with Lazio display|
|Copa Sudamericana Review: Emelec strike back at Sao Paulo|
|New York Red Bulls 2 Sporting Kansas City 1: Late winner denies reigning MLS champions|
|Robson: United talented as City|
|Verona 1 Lazio 1: Toni on the spot to earn a point|
|Varela returns to West Brom training|
|MLS announce new franchise Los Angeles FC|
|Newcastle United v Liverpool: Pardew vows to attack|
|UEFA sanction Slovan Bratislava and Sparta Prague|
|Pardew credits Hull fightback for upturn in form|
|Stoke City v West Ham: Allardyce sweating on Sakho´s fitness|
|Jovetic hungry for City goals|
|Fernandez red card rescinded|
|Chelsea v QPR: Redknapp ready to face Premier League´s best|
|Everton v Swansea: Martinez hails in-form attackers|
|SFA ban Tonev for seven games|
|Leicester City v West Brom: Pearson backs hosts to end slump|
|Arsenal v Burnley: Walcott set to return against bottom side|
|Koeman backs Southampton to maintain impressive start|
|Klopp wary of Dresden Pokal upset|
|Empoli v Juventus: Bonucci calls for greater maturity|
|Monk to meet with referee boss Riley|
|Parma v Inter: Crunch time for struggling Donadoni|
|Uchida extends Schalke deal|
|Liverpool must build on Swansea win - Rodgers|
|Hull City v Southampton: Koeman not worried about tiredness|
|Destro may consider Roma future|
|Raul completes Cosmos move|
|Bolasie working to adapt game|
|Bayern Munich v Borussia Dortmund: Kehl demands raised games|
|Bodmer pens Nice extension|
|Forest agree Ince loan|
|Simeone expected Atleti exits|
|Clark targets great escape after getting Blackpool job|
|Sakho ´touch and go´ for Stoke trip - Allardyce|
|La Liga Preview: Barca look to bounce back, Sevilla face Bilbao test|
|Icardi slams Inter boo-boys|
|Granada v Real Madrid: Ancelotti´s expectant side in red-hot form|
|Lorient v Paris Saint-Germain: Champions aim to stay in touch|
|Bundesliga Preview: Dortmund aim to end form slump at Bayern|
|Redknapp unconcerned over Ferdinand conduct|
|Atletico Madrid v Cordoba: Godin reveals Atleti motivation|
|Ligue 1 Preview: Strugglers Guingamp and Bastia face off|
|Ribery plays down supporter incident|
|Barcelona v Celta Vigo: Suarez set for home debut|
|Martinez praises influential Eto´o|
|Hernandez determined to shine|
|Kane hoping for starting role|
|Bonucci: Pitch not to blame for Juve loss|
|Pardew hails returning Taylor|
|Spain hit back in Costa row|
|Allegri slams Juve for Genoa loss|
|Copa Sudamericana Review: River Plate, Atletico Nacional grab leads|
|FC Dallas 2 Vancouver Whitecaps 1: Late penalty sends hosts through|
|Venezuelan Primera Division Review: Trujillanos triumph at Zamora|
|Liga del Futbol Profesional Boliviano Review: Bolivar reclaim lead, San Jose bounce back|
|Garcia not interested in Juventus´ loss|
|Copa do Brasil Review: Flamengo blitz Mineiro late|
|Guardiola: Hamburg ´surprised´ Bayern|
|Independiente del Valle 4 Universidad Catolica 0: Sornoza scores stunner|
|Paraguayan Division Profesional Review: Nacional extend Rubio Nu´s winless run|
|Ancelotti retracts Blatter criticism|
|Eredivisie Preview: Feyenoord-PEC a championship six-pointer|
|DFB Pokal Review: Leverkusen edge through on penalties, Bayern march on|
|Allegri unhappy with Genoa pitch and late goal|
|Bonaventura reveals ´lucky´ lob|
|Buoyant Pardew bullish after Newcastle triumph|
|Coupe de la Ligue Review: Late goal eliminates Marseille, Metz edge Nice on penalties|
|Pellegrini has defensive concerns|
|Serie A Review: Genoa shock Juve, Roma win again|
|Chelsea to face Derby in League Cup quarter-finals as Bournemouth host Liverpool|
|Inter 1 Sampdoria 0: Late Icardi penalty lifts Mazzarri|
|Genoa 1 Juventus 0: Antonini spoils Buffon milestone as champions suffer first defeat|
|Tottenham 2 Brighton and Hove Albion 0: Lamela and Kane put Tottenham through|
|Stoke City 2 Southampton 3: Late Pelle strike seals Saints progress|
|Manchester City 0 Newcastle United 2: Holders stunned on home soil|
|Cagliari 1 Milan 1: Bonaventura´s brilliance rescues a point|
|Hamburg 1 Bayern Munich 3: Returning Ribery inspires holders|
|Cornella 1 Real Madrid 4: Holders coast to easy Copa win|
|Fulham appoint Symons on full-time basis|
|Monk to face no action over Moses comments|
|Defensive duo earn first call-ups under Hiddink|
|Sturridge eager to link up with ´misunderstood´ Balotelli|
|Ferdinand receives three-match ban for misconduct|
|Vale turn to Page to start new era|
|Isla rubbishes Italy return rumours|
|Return to training a fantastic feeling - Carroll|
|Indian Super League Review: Elano inspires Mumbai hammering, Atletico held|
|O´Neill names provisional Republic of Ireland squad|
|Thai Premier League Review: Buriram go top with one game to go|
|King commits to Leicester|
|Swansea appeal Fernandez red|
|Schalke yet to begin Boateng talks|
|Championship Preview: Rowett reign begins at Birmingham, Derby travel to Brentford|
|League Two Preview: Whitlow takes charge of Burton, Luton eye eight in a row|
|Rummenigge risks fresh Reus row|
|Cabella targets consistency|
|Song wants Premier League stay|
|Ancelotti slams Blatter´s Ballon d´Or comments|
|Ancelotti calms Bale fears|
|Toure expecting more Balotelli goals|
|Clattenburg to miss weekend fixtures|
|Rodriguez surprised by Isco|
|Mourinho frustrated with fringe players|
|A-League Preview: City seek to avenge derby defeat|
|Pellegrini assured City will improve|
|Lovren: Balotelli´s goal ´a relief for everyone´|
|Coupe de la Ligue Review: Bordeaux win derby, Montpellier crash out|
|Howe hails history-making Bournemouth|
|Monk wants Fernandez red overturned|
|League Cup Review: Balotelli on target in late fightback, Chelsea edge through|