Brazil are one step closer to winning an elusive first Olympic gold medal in football after defeating Denmark 4-0 in their last opening-round game at the Rio Olympics on Wednesday.
Gabriel Barbosa scored twice, once in the 26th minute and again in the 80th, while Gabriel Jesus and Luan also scored for the hosts, in what was a must-win game for Brazil at the Fonte Nova Arena in Salvador.
The side had struggled to impose themselves on the tournament so far after two scoreless draws against South Africa and Iraq in its opening two first-round games of the tournament.
But a stylish first-half goal from Barbosa, after a pinpoint pass from Douglas Santos, broke the deadlock for the hosts and sent the crowd into celebrations, and the Brazilians never looked in danger thereafter.
Earlier, Argentina and defending Olympic champion Mexico both crashed out of the 2016 football tournament while Germany advanced to the quarter-finals with a 10-0 rout of Fiji.
South Korea ended Mexico's campaign with a 1-0 win in Brasilia courtesy of a 77th-minute goal from Suwon Bluewings midfielder Kwon Chang Hoon to top Group C.
Germany, after two draws against Mexico and South Korea, cantered to double figures against already-eliminated Fiji in Belo Horizonte to finish second in the group.
Freiburg striker Nils Peterson led the way with five goals, Schalke's Max Meyer scored a hat-trick and Arsenal midfielder Serge Gnabry notched a brace against the Fijian part-timers.
The win was the first for a German team at an Olympics for 28 years and the second-highest margin of victory since a 16-0 win against Russia in a consolation tournament 104 years ago in Stockholm.
In Brasilia, Argentina crashed out while Honduras advanced after a 1-1 draw in Group D in which both sides missed penalties.
Striker Antony Lozano converted from the spot for Honduras while Mauricio Martinez's stoppage-time goal was too late to save the Albiceleste.
Portugal drew 1-1 with Algeria in Belo Horizonte to finish top of the group, and will now meet the Germans in Brasilia on Saturday, while South Korea play Honduras in Belo Horizonte.
Brazil play Colombia, and Nigeria take on Denmark in the other two quarter-finals.