A controversial second-half penalty handed Brazil a narrow 1-0 victory over Italy to wrap up their Group C commitments.
However, despite beating the Italians who were already qualified, Brazil finished third in the group and a daunting task is awaiting them in the last 16 as they will face either France or Germany.
Italy, on their part, did the unexpected as they topped the group and will be now taking on one between Nigeria or China in the next round.
Australia, who eased past Jamaica 4-1, placed second and will meet Norway.
Story of the game
Italy coach Milena Bertolini opted for a third straight change in the offensive department as she decided to select Milan's Valentina Giacinti upfront.
Ilaria Mauro of Fiorentina and Milan's Daniela Sabatino had started the previous two games in this group.
On the other hand, Brazil were dealt a heavy blow prior to the game after it was announced that Andressa Alves will be missing the rest of the tournament due to a hamstring injury.
Meanwhile, coach Vadao was forced to replace the suspended Formiga with Andressinha.
The Brazilians were on the forefront from the early stages, attempting to strike first. But it was the Italians who almost forged ahead when Barbara Bonansea let fly a shot from the edge of the area just to be denied by Brazil's Barbara.
Past the quarter of play, Laura Giuliani came to Italy's rescue when she blocked a Debinha backheel to maintain parity in the game.
Italy thought they shed first blood when Cristiana Girelli scored a wonder goal but she was ruled in an offside position, rightly so.
On the brink of half-time, Bonansea saw a point-blank range shot blocked once again by Barbara as the first-half ended in a goalless stalemate.
After the change of ends, Brazil pushed more for the goal and Andressinha came closest with a wonderful freekick that struck the crossbar.
The Brazilians made their pressure count when they were handed a penalty midway into the second-half, with skipper Marta stepping up and score the winning goal for Brazil.
Takeaways of the game
Juventus' Bonansea was one of Italy's best players in this game, having two of the best chances for her side. In the past, she had already drawn the attention of Olympique Lyon, despite rejecting that offer to stay in Italy.
Juventus Women General Manager Stefano Braghin spoke during this tournament, underlining that he is aware of the fact that his players will be exposed in France but he is not concerned about any particular exits.
Meanwhile, Italy's qualification from this group is a testament to the hard work done in the past two years. For the record, the last Italy national team to top a World Cup group was the men's team in 2006...chi vivra, vedra.
Last but not least, a special mention to Marta. The Brazilian star is now the all-time top scorer in a men's or women's World Cup with 17 goals.
Marta's style of play has gone through a huge transformation in the past years, and although she is not the same player who can dribble past any opponent in a coast-to-coast, seeing one of best players in the women's game forging new records is always a landmark moment in this movement.