Germans top Ghana but both advance
Ghana also advanced despite Wednesday's loss at Soccer City and became the first African team to make the round of 16 at the first World Cup held on the continent.
"It was a tense game. We could have made more out of our opportunities," Germany coach Joachim Loew said. "We were not very precise up front. But I can't blame my young players, there was a lot of pressure, we had to win. And now we are really looking forward to England.
"It's going to be a special game, there is so much history between us. It's a team with many excellent players and a lot of experience. (Wayne) Rooney can explode any time, we'll have a tough job."
Germany won the group with six points and Ghana was second with four, going through on goal difference thanks to Australia's 2-1 victory over Serbia in the other match.
Oezil rifled a left-footed shot from outside the area into the left corner of the net to break the deadlock in the 60th minute after both teams had wasted a number of chances.
"I simply shot the ball, but I should have scored in the first half too," said Oezil, who was voted man of the match. "I had a lot of support from my teammates. It doesn't matter whom we play next, we have to keep winning."
"I am very relieved to have scored because I had missed many chances in the tournament," Oezil said.
Once the scoreboard had flashed the result of the other match, Ghana players celebrated their progress, waving the country's flag and running to the corner where their supporters were.
The Black Stars went through thanks to their 1-0 win over Serbia and a 1-1 draw with Australia.
"It was a very difficult match but we fought and it was enough to get us through," said Ghana midfielder Andre Ayew. "We had opportunities but the important thing is that we went through."
England finished second in Group C behind the United States and will now face the Germans in Bloemfontein on Sunday. Ghana will play the United States on Saturday in Rustenburg.
"There is no time to celebrate, the next match is very close," Ghana's Serbian coach Milan Rajevac said. "We knew it would be a tough match because to try to qualify against Germany is really hard. We played quite well, we resisted well, we had some chances but they had to win and they showed that they are among the best teams in the world."
Rajevac said he hoped the South Africans, whose team was eliminated, would throw their support behind his team.
Germany had been in danger of failing to advance from the group stage for the first time but the three-time champions had the upper hand throughout the match, without taking unnecessary risks.
"It was good for my young team to be in a make-or-break situation," Loew said.
Germany captain Philipp Lahm said his team had been under "enormous pressure."
"But we didn't get nervous and now we are already looking forward to England," Lahm said.
Ghana also had some chances and Kwadwo Asamoah ran through in the 51st minute but shot weakly at goalkeeper Manuel Neuer.
Oezil was clear in the 25th but Ghana goalie Richard Kingson blocked his shot.
In the first half, Ghana's Asamoah Gyan had a header from a corner cleared at the post by Lahm, and Kevin-Prince Boateng's header was wide.
Jerome Boateng, Kevin-Prince's half brother, played for Germany. The two had little contact during the game.
- Memorial set up for Paul the Octopus
- Bin Hammam rubbishes winter idea
- Corruption duo set to appeal FIFA ban
- Ex-Nigeria star takes own life in Texas
- Sepp Blatter endorses winter World Cup
- FIFA looks at golden goal rule again
- AFC chief backs call for winter 2022 WC
- U.S. hoping for World Cup bid spark
It was Kevin-Prince's foul in the English FA Cup final that forced Germany captain Michael Ballack out of the tournament with an injury.
Loew had said before the game that Germany would not target Kevin-Prince. Jerome Boateng, who was making his World Cup debut, had said before the game that the two half brothers had not spoken to each other since the start of the tournament.
"It was important for him not to get cautioned and keep his cool. I thought the German players were very correct with him," Rajevac said.
The two players have the same Ghanaian father and different German mothers. They were born and grew up in Germany, and Kevin-Prince played for Germany's junior teams before switching allegiance.
Ghana: Richard Kingson; Hans Sarpei, Jonathan Mensah, John Pantsil, Jonathan Mensah, Anthony Annan, Kevin-Prince Boateng, Andre Ayew (Dominic Adiyiah, 90), Kwadwo Asamoah, Prince Tagoe (Sulley Muntari, 64), Asamoah Gyan (Matthew Amoah, 81).
Germany: Manuel Neuer; Philipp Lahm, Per Mertesacker, Arne Friedrich, Jerome Boateng (Marcell Jansen, 72), Bastian Schweinsteiger (Toni Kroos, 81), Sami Khedira, Thomas Mueller (Piotr Trochowski, 67), Mesut Oezil, Lukas Podolski, Cacau.