A thundering strike on the hour by Germany's Mesut Ozil gave the three-times World Cup winners a 1-0 win over Group D rivals Ghana at Soccer City on Wednesday and a place in the second round.
Germany finished top of the section and will play England in the second round on Sunday in Bloemfontein. Ghana, the only African team to reach the last 16 so far, came second and will play the United States on Saturday in Rustenburg.
Australia beat Serbia 2-1 in the other match in the group, a result which meant both teams were eliminated.
Germany struggled to break down a solid Ghana defence before Ozil struck the winner in a match that saw two brothers -- Ghana's Kevin-Prince Boateng and Germany's Jerome Boateng -- face each other for the first time at a World Cup.
With Cacau replacing the suspended Miroslav Klose as their lone striker, Germany carved out chances with the Brazilian-born forward testing goalkeeper Richard Kingson with a low drive after only three minutes.
Cacau then set up Ozil with a perfect through ball in the box but the playmaker, with only Kingson to beat, could only manage a weak shot.
Ghana's defence, led by captain John Mensah returning from injury, gradually shut down the supply lines to Cacau and Lukas Podolski, forcing the Germans to try their luck with long-range efforts.
Germany poured forward, desperate for a goal, and had keeper Manuel Neuer to thank for not conceding a goal on the break when he pulled off a point-blank save from a Kwadwo Asamoah shot early in the second half.
Ozil finally broke the deadlock when he thundered a left-footed shot from 20 metres past Kingson.