Neymar, left, and Gabriel Jesus celebrate after scoring a goal in an Olympics win versus Denmark. Getty Images
Host nation Brazil finally broke out of an Olympics scoring slump to beat Denmark 4-0 and advance out of the group stages.
Gabriel Barbosa scored for the Selecao in the 26th minute to register the first goal for his country during the tournament thus far.
The goal seemed to open the floodgates for the struggling Brazilians, who began to pour forward. Just before half-time Gabriel Jesus added his team's second, pouncing on a beautiful cross to the far post from countryman Luan to make it 2-0.
Brazil picked up where it left off in the second half, as Luan calmly slotted home from six yards out following a nice build up and cross in from teammate Douglas Santos.
Gabriel added a second goal in the 80th minute, taking matters into his own hands with a left-footed shot from the centre of the box to the bottom-right corner.
The win, combined with a draw between Iraq and South Africa, sees Brazil finish top of Group A and advance to the quarterfinal round. The Brazilians will next play Colombia on Saturday in Sao Paulo.
Argentina crashed out at the group stage on Wednesday after drawing with Honduras 1-1 in Brasilia.
A 75th minute Anthony Lozano penalty gave the CONCACAF side, who qualified for the next round, a 1-0 lead before Mauricio Martínez pulled a goal back for the South Americans in second-half stoppage time.
The Albiceleste, who had threatened not to show for the tournament just weeks before the opening ceremony, couldn't muster a winner, however, and failed to reach the second stage of the competition for the first time since 1964.
In Group D's other match, Portugal finished top of the group with a 1-1 draw against Algeria.
Goncalo Paciencia gave the reigning European champions a brief advantage from the penalty spot before Mohammed Benkablia equalised for the Algerians just five minute later.
In addition to Argentina, defending Olympic champions Mexico were eliminated after falling 1-0 to South Korea.
Chang-Hoon Kwon scored in the 77th minute to qualify South Korea top of Group C. Hirving Lozano was sent off in second-half stoppage time for the Mexicans.
Germany, needing a win to advance, throttled Fiji 10-0 in Group C's second match.
Nils Petersen scored five times, while Maximilian Meyer added a hat trick and Serge Gnabry added a brace for the dominant Germans at the Mineirao, which was the scene of the senior team's 7-1 World Cup semifinal defeat of Brazil in 2014.
Germany will play in the quarterfinals against Portugal in Brasilia, while Honduras will face South Korea in Belo Horizonte.
In Group B, Colombia joined Nigeria in the knockout stage with a 2-0 defeat of the Africans in Sao Paulo. Teofilo Gutierrez and Dorlan Pabon scored in each half for the South Americans.
The result left Japan and Sweden with no chance to advance despite the former's 1-0 victory courtesy of a second-half strike from Shinya Yajima.
Iraq and South Africa were both eliminated following a 1-1 draw at the Arena Corinthians in Sao Paulo.
Saad Luaibi's 14th minute goal cancelled out an early opener from South Africa's Gift Motupa as both teams head home after finishing third and fourth in Group A.
-- Courtesy of ESPNFC