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'
|Cattermole ready for United test|
|Cahill confident of Chelsea success|
|Sherwood turned off by Palace´s lack of interest|
|Wenger wants Arsenal to atone Goodison thrashing|
|Ancelotti: Khedira free to leave|
|FC Dallas 2 Real Salt Lake 1: Hosts leapfrog RSL into second|
|Hughes warns suitors off Begovic|
|Supercopa a ´proud´ moment, says Simeone|
|Ancelotti: We did not need Di Maria|
|Koke hails new arrivals|
|Sluggish Monaco not fazing Berbatov|
|Recovery will take time, says Van Gaal|
|Atletico Madrid 1 Real Madrid 0 (2-1 agg): Mandzukic secures Supercopa|
|Guardiola satisfied with three points|
|Vitoria Guimaraes 3 Penafiel 0: Mensah brace inspires victory|
|Blanc has no worries despite Evian stalemate|
|Bayern Munich 2 Wolfsburg 1:Pep´s men kick off with a win|
|Heracles 0 Cambuur 1: Last-gasp defeat for pointless Heracles|
|Evian 0 Paris Saint-Germain 0: Cabaye sees red as champions frustrated|
|Al Hilal Omdurman 2 Zamalek 1: Al Madina ensures hosts of victory|
|McLeish returns to management with Genk|
|Mackay defends Bevan over controversy|
|Milan dealt blow in search for Balotelli replacement|
|Sunderland v Manchester United: Van Persie returns in much-needed boost|
|Depay agrees PSV contract extension|
|Barcelona v Elche: Confidence flows as Luis Enrique era dawns|
|N´Diaye leaves Sunderland for Betis|
|Dortmund can challenge Bayern - Hitzfeld|
|Van Gaal ´enchanted´ by Rojo|
|Tottenham v QPR: Redknapp returns to White Hart Lane|
|Hughes unaware of Palacios interest|
|Hull City v Stoke City: Visitors keen to spoil party|
|Hannover seal Briand deal|
|Emery braced for Fazio departure|
|Rodgers coy on Balotelli speculation|
|Xavi out to feel ´useful´ at Barca|
|Cardiff call for Bevan resignation|
|Mourinho: Club takes priority over players|
|Pellegrini ready for crucial Liverpool clash|
|Retirement not on Buffon´s radar|
|Swansea loan Carroll from Spurs|
|Taylor wants Liberty to become a fortress|
|Celtic enter Scepovic race|
|Samaras signs two-year deal at Albion|
|We cannot be complacent - Marcelino|
|Redknapp: Mackay should get second chance|
|LMA apologise for initial Mackay statement|
|Neymar a doubt for Elche clash|
|Alves confident of Enrique evolution|
|Ferdinand dreaming of England job|
|European and EPL clubs circling for Jets|
|Millen ready to lead Palace recruitment|
|Wenger: Wilshere should ignore critics|
|CONCACAF Champions League Review: Herediano start strongly|
|Lambert excited by ´big asset´ Cole|
|Copa Sudamericana Review: Barcelona, Deportivo Capiata in the box seat|
|Brazilian Serie A Review: Luciano inspires Corinthians, Cruzeiro extend lead|
|Blanc: Di Maria transfer difficult|
|Klopp eager to deny Leverkusen|
|Blanc optimistic over Ibrahimovic fitness|
|Tiote will stay - Pardew|
|Bruce laments ´stupid´ McGregor mistake|
|UEFA Europa League Review: Tottenham in late turnaround, Astra shock Lyon|
|League Two Preview: Morecambe, Burton out to continue fast starts|
|Sassuolo 4 Cittadella 1: Second-half rally sees Sassuolo into Coppa fourth round|
|Howard to take US sabbatical|
|Lokeren 1 Hull City 0: McGregor error gifts Belgians victory|
|Rwanda given Wednesday hearing for disqualification appeal|
|Pochettino hails substitutes´ impact|
|Mackay apologises over text message scandal|
|Brandao suspended over Motta incident|
|Borussia Dortmund v Bayer Leverkusen: Klopp expecting tough start|
|QPR complete loan deal for Vargas|
|League One Preview: Fleetwood, Preston face home tests|
|Chelsea v Leicester City: Schurrle expecting Chelsea improvement|
|Southampton v West Brom: Koeman wary of Albion|
|AEL 1 Tottenham 2: Late turnaround gives visitors play-off edge|
|CAF Confederation Cup: Al Ahly, Nkana out to reach last four|
|Swansea City v Burnley: Monk expecting stern examination|
|Bender close to Leverkusen return|
|Morocco will host Club World Cup despite Ebola concerns - FIFA|
|Schneiderlin not allowed to leave, insists Koeman|
|Dyche confident Burnley can strengthen|
|West Brom eye Samaras signing|
|Aston Villa v Newcastle United: Lambert wants more Weimann goals|
|MLS Preview: Sounders look to bounce back at Portland, Johnson banned for DC|
|Klose eyes European football|
|Monk warns Swansea over complacency|
|De Jong set for Newcastle return|
|Crystal Palace v West Ham: No excuses from Millen|
|Pearson looking for Chelsea indication|
|Blanc wants Rabiot to stay|
|Bowyer reveals Hull approach for Rhodes|
|Atletico out to gatecrash Barca, Real party once again|
|Barcelona go back to the future|
|CSL Preview: Beijing Guoan, Dalian Aerbin hit the road|
|Westwood returns to Ireland squad|
|Millen confident on Palace job prospects|
|Pedro struck down by gastroenteritis|
|Championship Preview: Magath preaches patience, Ipswich host East Anglian derby|
|Ribery not ready for Bayern return - Guardiola|
|Ancelotti: Di Maria has asked to leave|
|Moody resigns from Palace post|
|Everton v Arsenal: Martinez denies Everton have advantage|
|Coventry agree Ricoh return|
|Allardyce eyes defensive improvements|
|FA to investigate Cardiff dossier|
|Simeone not expecting to retain title|
|Balotelli bids farewell to Milan team-mates|
|Wenger open to signings after Arteta blow|
|Martinez to wait on Kone, Oviedo before considering late signings|
|Ocampos believes in Jardim´s methods|
|Villas-Boas calls for Zenit focus|
|Jovetic predicts bright future at City|
|Hamren hoping for quick Ibrahimovic recovery|
|Van Gaal retains focus on team ethic|
|Martinez calls for Everton consistency|
|Oxlade-Chamberlain: Arsenal´s best will come|
|Benaglio retires from Swiss duty|
|MLS Review: Galaxy stun Rapids, Sounders held|
|CONCACAF Champions League Review: MLS clubs shine|
|Panama 4 Cuba 0: Hosts finally win|
|K. League Preview: In-form Jeonbuk out to increase advantage|
|Copa Sudamericana Review: Penarol poised to advance, General Diaz on track|
|Liga MX Preview: America target another win|
|J.League Preview: In-form Kashima, Tokyo face tests|
|Fresh faces in Australia squad|
|Copa Argentina Review: River Plate, Estudiantes des Caseros reach quarters|
|Girard rues wasteful Lille|
|Scholes: ´I am scared for United´|
|Patient Inter got just rewards - Mazzarri|
|UEFA Europa League Review: Inter win in Iceland|