Three decades after Germany used trickery to eliminate Algeria, the Germans did it the honest way Monday, advancing to the quarterfinals with a 2-1 victory in extra time over the Desert Foxes. Andre Schuerrle scored in the 92nd minute, and Mesut Oezil added the game-winner in the 120th.

Abdelmoumene Djabou spoiled the shutout, scoring in stoppage time. But it was little consolation to the Algerians, with Sofiane Feghouli pulling his jersey over his head after the game ended. As his players left the field, coach Vahid Halilhodzic waved to acknowledge the applause of the Algerian fans.

“We are part of Algeria’s football history because we went further than any other team before,” goalkeeper Rais Mbolhi said. “We have to build upon this because we saw today that Algeria is able to play on equal footing.”

Germany has now reached the quarterfinals or better at nine consecutive World Cups, a streak that began in dubious fashion in 1982. Playing in its first World Cup, Algeria shocked the reigning European champions 2-1 in the group stage opener.

Algeria had a chance to advance after finishing the group stage with two wins and a loss, but would have to wait for the result of the Austria-Germany game a day later. Knowing exactly what each needed to advance, Austria and Germany conspired for a result that benefitted each of them – and kept Algeria out.

Algeria’s protest would be rejected by FIFA. But ever since the “Disgrace of Gijon,” group stage finales have been played simultaneously to prevent any collusion.

There was no doubting the effort by either team in this game, though it certainly raised some questions about how far Germany can go. Shredding Germany’s backline, Algeria tested Manuel Neuer often in the first half.

Islam Slimani had a goal in the 17th waved off by an offside goal, and a minute later Faouzi Ghoulam sent a shot from close range whistling by the far post.

“I’m supposed to be unhappy because we are in the last eight? OK,” Germany coach Joachim Loew said. “We didn’t play well in first half, that’s right. But matches of this kind will exist in a tournament where it’s matter of will.”

Germany was better in the second half, and only outstanding performances by Mbolhi and his defense kept the score from being more lopsided. Time and again Mbolhi turned away the Germans, making finger-tip saves or putting outfielders to shame with his catches.

And what he didn’t get, his defense did. At the end of regulation, Philipp Lahm had what looked like a sure goal, only to have Rafik Halliche slide it in to clear it off the line.

During the break before extra time, Halilhodzic went from player to player, exhorting and encouraging them. And it didn’t take a lip reader to know he was telling his players this was their time as they huddled before taking the field.

But the euphoria was short-lived as Schuerrle chipped in a cross from Thomas Mueller with his left heel in the 92nd minute.

“We’re very disappointed because we felt there was something to be done,” Mbolhi said. “Even playing a great team like Germany, we felt something could be done.”