Hosts Brazil finally found their form to progress to the quarter-finals of the Olympic soccer tournament with a comprehensive 4-0 win over Denmark on Wednesday, after holders Mexico and twice winners Argentina were sent packing.
After drab goalless draws in their first two matches, Brazil needed a win to calm the nerves of a soccer-mad nation and guarantee a place in the last eight, and first-half goals by Gabriel Barbosa and Gabriel Jesus provided a perfect platform.
Luan and Barbosa added two more goals in the second period to carry Brazil to the top of Group A and a Saturday showdown against fellow South Americans Colombia.
Despite the heavy defeat, Denmark advanced to face Nigeria after finishing in second place on four points, while Iraq and South Africa drew 1-1 in the other group game to both be eliminated.
Argentina, who were Olympic champions in 2004 and 2008, crashed out after they were held to a 1-1 draw by Honduras in Group D action, as Portugal topped the standings on seven points after a 1-1 draw with Algeria in the other match.
Honduras claimed the second qualifying spot by virtue of a superior goal difference over Argentina, who missed a penalty in their match, with both sides finishing on four points. Algeria were last after claiming a solitary point.
Germany were the big winners of the day, hammering 10 goals past Fiji, with Nils Petersen scoring five and Maximilian Meyer adding three as the European side ran riot against a team who conceded 23 goals in their first appearance at the Olympics.
The 10-0 win lifted Germany up to second spot in Group C above Mexico, who crashed out after Kwon Chang-hoon's 77th minute goal gave South Korea a 1-0 win.
The Koreans finished top of the group seven points, ahead of Germany on five. Mexico, who beat Brazil to win the gold in London four years ago, were eliminated along with Fiji.
South Korea will play Honduras in the quarter-finals on Saturday, while Germany face Group D winners Portugal.
Nigeria topped Group B, even though they lost 2-0 to Colombia, who finished second.
Two of Colombia's over-age players scored the goals -- Teofilo Gutierrez getting the first after four minutes and Dorlan Pabon doubling their advantage from the penalty spot after 63 minutes.
Japan, who beat Sweden 1-0 in the other match, finished third in the group as both sides were eliminated.