Neymar scored a brilliant brace as Brazil beat Cameroon 4-1 on Monday to secure top spot in World Cup Group A and a last-16 tie against Chile.
The Barcelona forward scored the 100th goal of the tournament in Brazil's 100th World Cup finals match to put the hosts ahead in the 17th minute. He restored their lead before the interval after Joel Matip had equalised for Cameroon.
Neymar has now scored four goals in his first three World Cup matches, equalling a feat achieved by his great predecessor Pele.
Fred got Brazil's third early in the second half with substitute Fernandinho adding a late fourth.
Brazil's win, combined with Mexico's 3-1 victory against Croatia in the other Group A game in Recife, ensured that they progress as group winners, ahead of Mexico on goal difference.
Brazil were much stronger, but head into Saturday's game against Chile in Belo Horizonte knowing that they can still improve.
Cameroon were already out of the tournament after losing their opening two matches, but the Indomitable Lions had the advantage of playing without any pressure.
Volker Finke's men passed the ball confidently early on and Vincent Aboubakar gave the hosts something to think about with a shot that was blocked by Marcelo, but it was Brazil who took the lead.
The opening goal came as a huge release for Brazil and their fans in the crowd of over 69,000.
Neymar's coolly sidefooted into the far corner of the net first-time from a low Luiz Gustavo cross.
However, the goal owed as much to the industry and craft of Luiz Gustavo, who did superbly to rob possession from Benjamin Moukandjo on the left before delivering a pinpoint ball.
It was the first time in the tournament that Scolari's side had scored the first goal of a game, and both Neymar and Fred came close to increasing their advantage, the latter lunging desperately to connect with a Paulinho cross but unable to scramble the ball home.
Read: 'Little bird' Neymar soars higher as Brazil demolish Cameroon
Fred off the mark
Instead, Cameroon silenced the home fans when they drew level in the 26th minute.
Allan Nyom got away from Dani Alves on the left and delivered a low ball that evaded Thiago Silva and David Luiz to give Matip the easiest of finishes. The Schalke player recorded Cameroon's first goal at this World Cup.
Brazil did not panic, and Neymar again intervened to restore their lead in the 34th minute.
Neymar celebrates after scoring his second goal. (AFP Photo)
When Nyom's headed clearance was returned by Marcelo, the Barcelona player collected possession and cut inside before sending in a low shot from the edge of the area that passed underneath Nicolas Nkoulou and went right through Charles Itandje in goal.
Scolari replaced Paulinho at the interval, sending on Fernandinho, and the Manchester City midfielder had an immediate impact, helping Brazil open up a two-goal cushion four minutes into the second period.
His pass released David Luiz on the left-hand edge of the area and the latter's centre was headed into a gaping goal from four yards by the grateful Fred, who scored his first goal of the finals.
The striker may just have been in an offside position when the cross came in, but the Swedish assistant referee did not raise his flag, much to Cameroon's frustration and Fred's relief.
Neymar was withdrawn for the closing stages and watched as Fernandinho poked home the fourth goal in the 84th minute, having combined superbly with Fred and Oscar after Cameroon lost possession in their own half.
Mexico's captain Rafael Marquez, appearing in his fourth finals, broke the deadlock in the 72nd minute to set his team on the way to a 3-1 win over Croatia in Recife.
Andres Guardado and Javier Hernandez added the further goals so that Mexico now play Netherlands in the next round.
Midfielder Hector Herrera was desperately unlucky to see 25-yard strike cannon back off the crossbar on the quarter-hour.
Mexico also had a penalty appeal for a handball against Darijo Srna turned down in the second half. But Croatia were eventually undone as Marquez rose highest to head home a corner from Herrera.
Mexico doubled their lead on 75 minutes as Guardado steered home after he was picked out in the box by Oribe Peralta.
Substitute Hernandez then ghosted in unmarked to nod in a header at the far post as Miguel Herrera's men picked apart a ravaged Croatia defence at will.
Croatia pulled one back through Ivan Perisic three minutes from time while substitute Ante Rebic was sent off in the dying stages for a wild lunge on Carlos Pena.