Mexico will play South Korea in the quarter-finals of the Olympics after beating South Africa 3-0 in their final group game.
El Tri's victory on Wednesday saw them finish second in the group behind Japan, who claimed top spot after beating France.
France's 4-0 defeat by Japan was the second time they had conceded four goals in the tournament, while Argentina and Germany also failed to make it through to the knockout stages.
Who else is in the quarter-finals?
Brazil's hunt for a second consecutive Olympic gold medal will continue with a quarter-final clash against Egypt.