Germany won its Women's World Cup group for the fifth consecutive time and avoided an immediate matchup with the United States by routing South Africa 4-0 on Monday.

Germany topped Group B with a 3-0 record and will play a third place team in the round of 16 on Saturday at Grenoble.

After Germany grinded out 1-0 wins over China and Spain, its offence broke out with three goals in the first half, matching its total goals in its previous five World Cup games combined.

"We are happy that we won the group and did so with a good performance tonight," said Sara D├ñbritz, who contributed the second goal. "We could have scored even more. I think we are ready for the round of 16."

Germany had clinched a spot in the knockout rounds after two matches.

South Africa was winless in group play and outscored 8-1. At 49th, South Africa had the lowest ranking of the 24 teams in the tournament.

Spain finished Group B as runner-up after a 0-0 draw with China and advanced to the knockout stage for the first time. Spain will face the winner of Group F on Monday at Reims, and the United States would be the opponent with a victory or draw in its final group match against Sweden.

Melanie Leupolz opened the scoring in the 14th minute with her first goal for Germany since the 2016 Olympics. D├ñbritz doubled the lead in the 29th minute and Alexandra Popp made it 3-0 in the 40th. Lina Magull added the final goal in the 58thth.

Two-time tournament champion Germany has not lost a match in group play since falling to Sweden in 1995.

"Germany has won tournaments that it stared out with difficulties," Germany coach Martina Voss-Tecklenburg said through a translator. "It would be great to have the same this time. All the matches will be challenges, and I hope we will be able to meet them all."

Germany didn't miss the playmaking of Dzsenifer Marozsan, who broke a toe in its opener. Voss-Tecklenburg said she couldn't guarantee the Lyon midfielder will be ready for the round of 16.

Leupolz put Germany ahead when she was left all alone on the edge of the 6-yard box to deftly nod a corner kick into the far corner of the net.

D├ñbritz made it 2-0 after a blunder by goalkeeper Andile Dlamini, who turned what appeared to be a poor German pass into a perfect assist.

Left back Verena Schweers's cross looked like an easy grab for Dlamini, only for Dlamini to parry the ball right into the path of D├ñbritz, who got her second goal of the tournament.

"We conceded poorly from a set piece and a second goal as well and were on our back foot from there," South Africa coach Desiree Ellis said.

Germany boosted the lead to 3-0 with pure power. Popp, the team captain, jumped over her marker to drive home a header.

Magull took the fourth goal when she rushed in to finish off a save by Dlamini, who did well to push a header by Marina Hegering off the post, only to see the ball bounce across the open goalmouth.

Only Dlamini's sharp reflexes saved South Africa from a greater defeat.

"We always knew it would be a challenge," Ellis said. "We are happy with the performance but not the result."