Brazil maintained their 100% record at the Women's World Cup as three second-half goals defeated Equatorial Guinea.
In a key quarter-final on Sunday the 2007 runners-up will meet two-time winners the USA, who were beaten 2-1 by Sweden in their Group C finale.
Australia came from behind to defeat Norway 2-1 and claim second place behind the Brazilians in Group D, with both goals scored by Kyah Simon.
They will play Sweden in the last eight of the tournament.
Cristiane's last-minute penalty, adding to her earlier second-half strike and a goal just after the break from Erika, sealed Brazil's victory in Frankfurt.
Erika opened the scoring in fine style as she controlled a loose ball on her chest, then tapped it from her right foot to the left and sent a close-range volley past goalkeeper Miriam.
The USA, who won the tournament in 1991 and 1999, were two down after 35 minutes against Sweden, Lisa Dahlkvist netting a penalty after a quarter of an hour and captain Nilla Fischer adding a free-kick via a deflection off Amy Le Peilbet's thigh.
Veteran Abby Wambach's 67-minute strike could not prevent Sweden topping the group and they will play the Australians in Augsburg on Sunday.
Colombia and Korea, who had both lost their opening two matches in Group C without scoring, drew 0-0.
Korea finished third having conceded one goal less than the Colombians.