Spain are out of the Olympic men's football competition after suffering a shock 1-0 defeat by Honduras.
The Hondurans, who won thanks to Jerry Bengtson's early goal, progress from Group D along with Japan, who beat Morocco 1-0.
Brazil beat Belarus 3-1 to qualify from Group C, while Egypt drew 1-1 with New Zealand.
In Group B, Mexico picked up a 2-0 victory against Gabon and South Korea secured a 2-1 win over Switzerland.
Bengtson, who scored both goals in his side's opening 2-2 draw with Morocco, found the net against Spain after eight minutes in Newcastle.
Spain, who lost their opening game 1-0 to Japan, hit the woodwork three times in the second period.
Japan secured their place in the knockout phase when Kensuke Nagai's late effort earned them victory against Morocco.
Renan Bressan opened the scoring for Belarus against Brazil at Old Trafford but Neymar crossed for Alexandre Pato to head in, curled in an impressive free-kick and then laid on a third goal for Oscar.
Egypt must now beat Group C's second-placed team Belarus on Wednesday to progress after a 1-1 draw against New Zealand.
Chris Wood give the All Whites the lead before Mohamed Salah equalised from close range just before the interval.
South Korea's win over Switzerland came courtesy of goals from Park Chu-Young and Kim Bo-Kyung, either side of Innocent Emeghara's effort.
The victory moves South Korea level with Group B leaders Mexico, who beat Gabon thanks to two goals from Tottenham's Giovani dos Santos.