Germany had to battle all the way into extra-time to beat Algeria 2-1 in their last-16 World Cup clash on Monday, crushing the North Africans' dream of revenge and setting up a quarter-final duel against fellow former champions France.
The Germans were pushed hard by an inspired Algeria before goals from Andre Schuerrle and Mesut Ozil sealed victory in a tense game marked by swift Algerian counter-attacks and a second-half German barrage of the "Desert Foxes" goalmouth.
The North African outsiders, representing the hopes of the Arab world, played with energy and confidence to regularly expose a static German defence but the European team's power and fitness counted in the end.
With the score 0-0 at full-time, Schuerrle dragged in a low-cross from Thomas Mueller. Ozil buried the Algerian dream in the last minute - but in a final moment of drama, Abdelmoumene Djabou grabbed a consolation goal for the brave Algerians just before the final whistle.
The victory extended Germany's record of reaching at least the quarter-finals in every World Cup they have entered since 1938 and gave them their first win in three attempts against Algeria, who were playing in the last 16 for the first time.
"We would have preferred to have won this differently. The Algerians did a good job, they disrupted us from the start and didn't let us get into our game," Schuerrle told reporters.
"But it doesn’t matter how we won, the important thing is that we're in the quarter-finals now against France.”
The result also denied Algeria, who famously beat West Germany in a 1982 World Cup group game, revenge for the so-called "Disgrace of Gijon".
After that Algerian victory, West Germany secured a narrow win over Austria in a farcical, half-hearted game in Gijon which saw both of them go through at Algeria's expense - and drew accusations of a stitch-up.
The history weighed heavy on Monday's clash with Algeria coach Vahid Halilhodzic saying it would motivate the "Desert Foxes". For the first half at least, it looked like they might have that revenge.
Lack of inspiration
"At the end it was a victory of will and strength of will. We had a hard time in the first half and lost a lot of balls. We were the better team in the 2nd half. We had enough chances to have decided it," German coach Joachim Loew said.
"We lost the ball a lot. We practically invited Algeria to run counter attacks against us."
Germany, playing in all-white and with seven Bayern Munich players in the starting line-up, took a long time to get into their stride on a cold, overcast day at the Beira Rio stadium, with most of the thrills coming from swift Algerian counter-attacks.
The Germans tried to find Mueller – scorer of nine goals in his nine previous World Cup matches - in early probes but the passes were just too far ahead of him.
Algeria showed just what a threat they posed early on when Islam Slimani broke down the left and goalkeeper Manuel Neuer charged out of the box to cut him off.
Germany began to play with more purpose and Ozil had a couple of shots parried by goalkeeper Rais Mbolhi.
Mueller headed wide and a long-range shot from Toni Kroos was batted away by the Algerian keeper.
In the second half, Germany began to gain the ascendancy.
Shkodran Mustafi leapt to a cross but Mbolhi stopped the header and a shot by captain Philipp Lahm from outside the area was tipped away for a corner.
It looked all over for Algeria when Mueller rose to head at goal from a few metres out but the magnificent Mbolhi again saved.
Just two minutes into extra time, substitute Schuerrle finally broke Algerian resistance before the late exchange of goals from Ozil and Djabou.
"OK, we didn't play well in the first half but the decisive element is that you make it to the next round," Loew said.
All the African teams are now out of the World Cup but Algeria, the continent's top-ranked team, have won many admirers in Brazil.
The Beira Rio stadium rang to chants of "Algerie, Algerie," from their devoted fans after the heart-breaking match.
"It's true we are part of Algeria football history, we went farther than any other team before. We have to build upon this performance for the future since we saw today that Algeria is able to play on an equal footing at a very high level with other teams," Mbolhi said.