Update: 11:28AM Neymar lived up to the expectations of the World Cup host nation today, scoring two goals as Brazil routed Cameroon 4-1 to reach the knockout stage as the top team in Group A.
Fred and Fernandinho added second-half goals for Brazil, which will face South American rival Chile in the second round.
Neymar netted twice in the first half, on either side of midfielder Joel Matip's goal for Cameroon in the 26th minute.
He opened the scoring off a low cross by midfielder Luiz Gustavo in the 17th, deftly side-footing the ball home from close range, then restored the lead with a low right-foot strike from the top of the penalty area in the 35th after a pass by left back Marcelo.
"If I'm not mistaken this is our best game yet," Neymar said. "Everyone deserves congratulations for their efforts until the end."
Fred found the net in the 49th and the substitute Fernandinho struck in the 84th.
Brazil finished Group A with seven points after two wins and a draw. It ended with the same points as Mexico, but had a better goal difference. The Mexicans eliminated Croatia with a 3-1 win in Recife.
Playing in its 100th World Cup match, Brazil needed at least a draw to advance. Elimination in the group stage would have been unthinkable for the five-time world champions playing at home. The only team to play in all 20 World Cups, Brazil has advanced to the second round in every tournament since 1970.
Boosted by a crowd of nearly 69,112 at the Estadio Nacional in the nation's capital, Brazil began the match pressuring Cameroon and created many scoring chances early. But the African team eventually picked up the pace and was able to keep the hosts from threatening too much.
Despite playing without Samuel Eto'o because of a lingering right knee injury, Cameroon had a few good chances, even when the match was level in the first half.
"The first half was not so bad, but we need to focus for 90 minutes, and this is not the first time that this happened," Cameroon coach Volker Finke said. "Some goals were not needed, three times we had the control of the ball and we lost it."
It was Neymar who got on the board first, neatly finding the net after Gustavo stole the ball on the left flank and sent a low cross into the area.
Cameroon equalised after a nice run by Allan Nyom ended with Matip's goal, but Neymar again showed he is carrying the hopes of the entire nation, running toward the area and then moving to his right in front of a couple of defenders before firing a low shot into the net.
The 22-year-old Barcelona striker had already been decisive in the 3-1 opening win over Croatia, when he also scored twice while Brazil was struggling.
Brazil improved in the second half and Fred, who had been loudly criticized for his lackluster performances, got his first goal of the tournament with a header from close range after a cross by defender David Luiz from the left. Cameroon players complained of offsides.
Fernandinho, who replaced Paulinho in the second half, closed the scoring after Oscar stole possession from a Cameroon defender near the area. Quick passes by Fred and Oscar set up the midfielder's toe poke from short range.
Cameroon, which hasn't advanced to the second round since becoming the first African nation to reach the World Cup quarterfinals in 1990, likely saw Eto'o playing in his final World Cup.
The 33-year-old striker, in his fourth World Cup, is the team's all-time leading scorer.