Neymar scored twice in a man-of-the-match display as Brazil rediscovered their attacking flair to overwhelm Cameroon and qualify for the World Cup knockout stage.
The 22-year-old produced two brilliant first-half strikes either side of a Joel Matip equaliser, with Fred and Fernandinho assuring their side of a place in the last 16 as winners of Group A.
Standing between the hosts and a place in the quarter-finals are Chile,and Brazil can approach that meeting in Belo Horizonte on Saturday with renewed belief that they are serious title contenders.
The Barcelona forward was back at the scene of his spectacular goal against Japan in the opening game of last year’s Confederations Cup, which kick-started Brazil’s march to that title, and coach Luiz Felipe Scolari will desperately hope this result can have a similar impact.
Scolari named an identical line-up to the one that beat Japan, meaning Hulk returned from injury to replace Ramires in the same 4-3-3 formation that edged them past Croatia.
Any frustration from Tuesday’s 0-0 draw with Mexico appeared to have dissipated as droves of yellow-and-green-clad fans created a sensational atmosphere inside Brasilia’s magnificent Estadio Nacional, and Brazil responded by pouring forward in search of an early goal.
They almost had it when a Paulinho shot was blocked after Neymar played in Hulk to cross, but such attacking ambition left them exposed in defence and Cameroon looked to capitalise.
A sharp break ended with Marcelo blocking a goalbound Vincent Aboubakar strike before David Luiz was forced to frantically clear Eric Choupo Moting’s low centre inside the six yard box.
Brazil did not, however, seem in the mood to curb their natural instincts and after Neymar had been riled by Allan Nyom’s off-the-ball shove, the 22-year-old made his mark.
Luiz Gustavo won possession on the left and crossed for Neymar to open his body and beat Charles Itandje with a delightful first-time, side-footed finish into the bottom corner.
It was a fitting way to register the 100th goal of this World Cup – and the same man almost made it two with a ferocious volley that Itandje did well to punch away.
The stadium was rocking but would soon fall silent as Cameroon exposed the hosts’ shaky defence, Nyom beating Dani Alves and squaring for Matip to escape Luiz and finish from close range.
Scolari gesticulated wildly to his players and they responded in the only way they know, Marcelo finding Neymar to race upfield and wrong-foot Itandje for his 35th goal in 52 internationals.
Neymar was now showboating and he combined with Oscar and Paulinho to set up Hulk for what would have been a sensational team effort, only for Hulk to miscue.
Scolari replaced Paulinho with Fernandinho at half-time – a move many supporters and pundits have been calling for in recent days – and it had an immediate impact.
The Manchester City midfielder sent Hulk clear, Henri Bedimo arriving with a perfectly timed challenge, and then found Luiz to cross for Fred to extend Brazil’s lead.
Replays suggested he was offside but referee Jonas Eriksson stood firm and Fred celebrated a moment that should help his confidence after poor showings against Croatia and Mexico.
Fernandinho slotted home a superb fourth that his contribution deserved and Brazil’s satisfaction was increased by the fact that all of their players who were one booking away from a suspension – Neymar, Thiago Silva, Luiz Gustavo and Ramires – finished without punishment.
Brazil coach Luiz Felipe Scolari: “I think Fernandinho coming in was critical and we created a number of good chances in attack. Nature doesn’t make leaps, things evolve step by step and this is what we are doing.
“If I could choose I would have picked someone else as Chile are a good South American team, they have quality, they are organised they have the will to succeed.
“I will look at things when all the adrenaline has left our bodies. Sometimes when we look at the match again in the cold light of day we see it in a different way.”
Brazil striker Neymar: “There is no pressure. I’ve always said there is no pressure when you are making a dream come true and doing something you have sought after since you were a kid.
“I’m now playing in matches that I always dreamed about. I just want to help my fellow players not only by scoring goals but doing whatever it takes on the pitch to help us win.
“We are on the right track and the whole team is getting better and getting close to our target.”
Cameroon coach Volker Finke: “Over the last two or three years we have not been that good but we managed to qualify for the World Cup and now we are disappointed we have not won a match.
“It’s terrible and we are suffering this but we have gained experience and what we need to do is focus and concentrate for the next challenge.
“The first half wasn’t so bad but it’s true we need to focus for the whole 90 minutes.”