Germany beat Ghana 1-0 which puts them on top of their group setting up a match on Sunday against England in Bloemfontein.
Midfielder Mesut Oezil scored in the 52nd minute to secure victory for the three-time champions.
The Germans topped Group D with six points while Ghana's Black Stars go through to the knockout stages by virtue of a superior goal difference over Australia, with both teams ending the first round on four points.
Serbia were knocked out along with the Socceroos after finishing last in the group with three points.
Ghana, who needed only a draw to go through, created plenty of opportunities in the first half but showed no sense of urgency and wasted their chances with mild attempts at goal.
Germany, however, needed a win to ensure themselves a place in the second round and their attack were aggressive from the start.
The Black Stars escaped an own goal in the 11th minute when a Lukas Podolski cross deflected off Jonathan Mensah but was saved by goalkeeper Richard Kingson who dived right to keep it out.
Germany continued to push forward and Oezil came close to breaking the deadlock in the 25th minute when he broke through the Ghana defence.
With only the keeper to beat, however, Oezil's effort was kept out by a charging Kingson. Ghana managed to lift the pace of the game in an effort to regain some control and a minute later a header from Asamoah Gyan was blocked by Germany captain Philipp Lahm who was standing guard at the right post.
With matters all square at the break, Germany again came out firing in the second half, while Ghana tried to push forward on the counter attack.
Kwadwo Asamoah had a chance to give Ghana the lead in the 52nd minute when he broke clear, but with only Manuel Neuer to beat he fired his shot into the Germany keeper's legs.
And eight minutes later Germany, three-time champions of the global showpiece, were rewarded for their attacking mindset when Oezil's strike from the edge of the box found the top left corner of the net.
Once they had taken the lead, the Germans took their foot off the pedal and managed to slow the game down in an effort to hold possession.
While Ghana were unable to capitalise on the few occasions they broke through the German defence, they nonetheless qualified for the knockout stages.
Ghana face the United States in Rustenburg on Saturday in the Round of 16, while Germany are up against England in Bloemfontein on Sunday.
Ghana 0 Germany 1
Serbia 0 Ghana 1
Germany 4 Australia 0
Germany 0 Serbia 1
Ghana 1 Australia 1
Germany 3 2 0 1 5 1 6
Ghana 3 1 1 1 2 2 4
Australia 3 1 1 1 3 6 4
Serbia 3 1 0 2 2 3 3