Germany 2, Algeria 1

When it comes to the knockout stages of the World Cup, wins are worth more than style.

That was on full display Monday when Germany labored to a 2-1 extra-time win over an aggressive Algeria side to reach the tournament’s quarterfinals for the ninth consecutive time.

“You don’t have to play fantastic every match,” Germany coach Joachim Loew said. “You have to win.”

All three goals came in extra time after Algeria dominated for long stretches during the opening 90 minutes. Germany substitute Andre Schuerrle scored in the 92nd minute and Mesut Ozil made it 2-0 in the 120th before substitute Abdelmoumene Djabou pulled one back in injury time for Algeria.

Three-time champion Germany will next face 1998 winner France on Friday at the Maracana Stadium in Rio de Janeiro.

“It was a victory of will power,” Loew said. “We had major problems in the first half to organize the way we played. We made simple mistakes, which invited the opponents to start counterattacks.”

Germany finally took the lead when Thomas Mueller provided a cross from the left flank that was slightly behind Schuerrle. The Germany forward dragged his left leg and backheeled the ball into the far corner, leaving goalkeeper Rais M’Bolhi with no chance.

With the temperature a chilly 57 degrees and a light rain falling at times, the pace was high at the Estadio Beira-Rio but the goals didn’t come until the end.

“Yes, we had our problems but at the end we were better and had a lot of chances,” Loew said.

Ozil thought he had put the result out of reach when he pounded in a rebound after a shot from Schuerrle was cleared off the line by defender Esseid Belkalem, but Djabou volleyed in a minute later to make the last seconds count.

Perhaps inspired by the “Disgrace of Gijon” at the 1982 World Cup, when Germany and Austria supposedly conspired to oust Algeria in the group stage, the northern African nation outmatched Germany’s intensity for long stretches in an entertaining match.

Algeria was playing in the second round of the World Cup for the first time and thought it had taken the lead before a goal from Islam Slimani was waved off for offside in the 17th, one of many opportunities for the Algeria striker.

“We fell just short,” said Rais, who was voted man of the match. “That’s why we’re disappointed, because we think more was possible tonight.”

At the start of the second half, Germany put Schuerrle on for Mario Goetze in an attacking midfield and came out better organized.

France 2, Nigeria 0

Paul Pogba scored with a late header to finally break Nigeria’s stubborn resistance and Joseph Yobo added an own-goal as France advanced to a World Cup quarterfinal against Germany.

Four years ago, the French squad crashed out of the group stage, shamed a nation by going on strike and was jeered by its own fans and lambasted by politicians in the fallout from an embarrassing tournament.

“I’m proud of my players because we’re coming back from very far. I think we’ve given a lot of pleasure back to our fans,” France coach Didier Deschamps said. “I think there were 5,000 here and millions back home who will feel proud.”

Pogba’s crucial goal came after Nigeria’s best spell of the match.

Nigeria goalkeeper Vincent Enyeama had just made a superb save to tip over Karim Benzema’s header, but he flapped at the ball from the ensuing corner and Pogba pounced in the 79th minute to nod in his first goal of the tournament. That atoned for a scrappy first half in which he gave the ball away carelessly and placed a volley too close to Enyeama.

Yobo, who announced his international retirement after the game, turned the ball into his own net in stoppage time under pressure from France substitute Antoine Griezmann.

Pogba said, “We know we’re capable of playing our best match and playing the worst, but today we were good. We stuck together and I’m very happy.”