Already eliminated Peru got their first World Cup win in 40 years and their first goal in 36 with a 2-0 victory over Australia on Tuesday, a result that condemned the Australians to last place in Group C.
The Socceroos needed to win to have any chance of progressing but missed every chance that came their way. Andre Carrillo put Peru ahead with an 18th-minute volley before Paolo Guerrero doubled their lead five minutes into the second half with a hooked shot from close range.
The result means that France and Denmark, who drew 0-0 in the group's other match, both qualify for the last 16.
Group winners France will play the runners-up in a group containing Argentina, Croatia, Iceland and Nigeria, while Denmark will play the team who finishes top.