Extra-time goals by André Schürrle and Mesut Özil sealed Germany's 2-1 win over Algeria in Monday's last 16 clash to put the three-time winners into the World Cup quarter-finals.
The victory at Porto Alegre's Beira-Rio Stadium was Germany's first over Algeria at the third attempt, but this was a far from impressive display by the Germans over 120 minutes.
Schürrle's deft flick on 92 minutes, then Özil's 119th-minute tap-in was enough to put Joachim Löw's Germany into Friday's quarter-final at Rio de Janeiro's iconic Maracana stadium against France.
"We'd have preferred to win in 90 minutes, but the Algerians did a good job," said goal-scorer Schürrle. "We don't care how we did it, the main thing is we're in the quarter-finals."
Algeria grabbed a deserved consolation just before the final whistle as replacement Abdelmoumene Djabou claimed his second World Cup goal.
The stats show Germany had more than three times as many shots on goal as Algeria and their lack of finishing is a concern for Löw.
"That victory was down to sheer willpower," admitted the German coach. "We gave away a lot of ball, made too many defensive errors and allowed them to counter-attack us. It was just as well that (Germany goalkeeper) Manuel Neuer came out time and time again. Our finishing must be better against France."
Much of the pre-match talk had been of Algerian revenge more than three decades after the 'Shame of Gijon' when Germany's mutually beneficial 1-0 win over Austria sent Algeria home from the 1982 World Cup.
But Germany progress to the last eight at the expense of the north Africans, who had reached the last 16 of a World Cup for the first time.
Algeria goalkeeper Rais M'Bohli produced a string of saves to frustrate
Germany's mis-firing attack in a man-of-the-match performance.
"We're very disappointed, because we felt there was something to have been had from this match," said M'Bolhi.
"We're part of Algerian football history, no other team went so far before and we showed we can play on an equal footing at the highest level. We really want to build on this and push on."
PHOTO GALLERY: Germany beat Algeria in World Cup
Schürrle's goal was just reward for a battling display as he created a string of chances after replacing the ineffective Mario Götze at the break.
A blocked Götze shot and a Thomas Müller header were all Germany had to show for an opening 45 minutes which allowed Algeria to grow in confidence.
Algeria had by far the better of the opening exchanges and forward Islam Slimani had the ball in the German net on 16 minutes, but was flagged for offside.
Schürrle made the difference after the break as left-back Benedikt Hoewedes headed straight at M'Bolhi, while Germany captain Philipp Lahm fired wide with a long-range effort on 54 minutes.
Algeria kept pushing forward, but only a crucial M'Bolhi save denied Mueller with a bullet-header on 80 minutes before he hit the side netting moments later.
Extra-time had barely begun when Mueller fired in a cross which Schürrle deflected into the back of the net with a deft flick to spare German blushes.
Özil looked to have killed off Algeria's hopes when he added the Germans' second just before the final whistle after an exchange of passes with the impressive Schürrle.
But there was still enough time for Djabou to blast home a thunderbolt of a shot to spark faint hope before the referee ended Algeria's quarter-final dreams.
SEE ALSO: Eight facts about Germany and Algeria