After two draws against the much-fancied pair of Mexico and South Korea, Germany required a glut of goals to seal a place in the next round. Horst Hrubesch's team will take on Portugal in the last eight.
Freiburg striker Nils Petersen scored five times as Germany obliterated Fiji 10-0 in the final group stage match of the men's football tournament at the Olympic Games.
The 27-year-old striker - one of three over-aged players in the Germany squad - had a hat trick by half-time and added another two before the end. Serge Gnabry bagged a double, while Schalke's Max Meyer (pictured above) hit three to book a quarterfinal with Portugal on Saturday evening.
The Estádio Mineirão in Belo Horizonte has happy memories for the German national team who racked up seven goals on their last visit in the famous semifinal win over Brazil at the World Cup, two years ago. If they managed five and the other group tie finished in a draw, Germany would have progressed in top spot.
The world champions needed just eight minutes to break the deadlock with Arsenal's Gnabry picking up where he left off against Mexico and South Korea. Petersen added a second on 14 minutes with the former Bayern Munich striker bringing a more conventional center-forward presence compared with Davie Selke who started the previous two encounters.
Going for goals
Goals were the focus for Germany in order to progress and in the last quarter of an hour in the first period, Hrubesch's side essentially made qualification safe. On 30 minutes, Meyer made it three before Petersen finished off Klostermann's cross three minutes later.
Leverkusen's Julian Brandt set up Petersen for his hat-trick after 40 minutes, and Gnabry converted a free-kick, his fifth of the competition.
A couple of changes for Germany at the break didn't upset the momentum as Fiji, ranked 187th in the world, imploded under pressure. Meyer, captain of the side, looked excellent, showing maturity beyond his years, and he secured a hat-trick after 52 minutes.
The Schalke star missed the chance to add a fourth, five minutes later, but he passed up the opportunity from the penalty spot. Petersen rounded off the rout, scoring twice in the space of seven minutes to send Germany into the quarterfinals. Korea's late winner against Mexico means Germany go through in the second place.