An inspired second-half showing from Brazil earned the Confederations Cup hosts a 4-2 win over Italy in Salvador on Saturday to win Group A and avoid a potential semi-final meeting with Spain.
The dubious honour of facing the world champions in a Thursday semi in Fortaleza is now likely to be Italy's fate assuming the Spanish, with two wins under their belts ahead of their final meetnig with Nigeria, top Group B.
Brazil made it three wins in three games at the event to earn a probable semi-final with Uruguay in Belo Horizonte on Wednesday.
Brazil started looking like a side who had been energised not just by their opening wins and clean sheets against Japan and Mexico but also the waves of popular protest by citizens demanding better social policies and an end to state corruption.
Brazil coach Luiz Felipe Scolari indicated he saw the pieces slowly falling into place although he has made the World Cup the overriding top priority rather than success this month.
"We beat a strong Italian team and I think this shows we are on the right road, even if there are a few things we need to improve," said Scolari, mastermind of Brazil's 2002 World Cup success and brought back last November for a second spell in charge of the Selecao.
We beat a strong Italian team and I think this shows we are on the right road, even if there are a few things we need to improve... We mustn't get carried away
"We mustn't get carried away," said Scolari, who earlier urged his compatriots to be patient with their demands for institutional reform.
Looking to cheer the nation, the whole Brazil squad sang the national anthem with gusto and then set about chasing an early goal.
An early Oscar flick sent in Neymar, but the Barcelona-bound striker fired wide and then picked up a yellow card after a clumsy challenge on Italian fullback Ignazio Abate
On the half hour Italy made an early change in sending on Emmanuele Giaccherini to replace Riccardo Montolivo before Brazil also had to reshuffle the pack as broken nose victim from their previous match, David Luiz, went off with a knock, giving way to Dante.
Italy then lost Abate to a suspected dislocated shoulder, Christian Maggio coming on, before Brazil took the lead on the stroke of half-time.
Six minutes after the restart, the four-time world champions were back on level terms as Mario Balotelli produced a neat backheel which played in Emanuele Giaccherini down the right.
The Juventus forward breezed past a static Thiago Silva and drove firmly into the corner of Julio Cesar's net as the Azzurri set about trying to beat Brazil for the first time since their epic 1982 World Cup meeting decided through Paolo Rossi's unforgettable hat-trick.
Neymar on target
Italy were missing injured playmaker Andrea Pirlo's guile and found themselves behind once more ten minutes after the restart as Neymar, who ended a nine-game goal drought with the tournament's opener against Japan, crashed home a freekick for his third goal in three games.
The spiky-haired forward wheeled away, breaking into a spot of samba as the crowd erupted.
After 66 minutes it was 3-1 as Marcelo lifted a high pass through for Fred to smash home a left-footed drive which ripped past Buffon to spark further delight at the Arena Fonte Nova.
Giorgio Chiellini gave Italy hope in pulling back to 3-2 in the 71st minute with a low shot after Balotelli appeared to have been impeded in the box.But Italian hopes of pulling things back ended when, after Christian Maggio had hit the bar at the other end, Fred made it 4-2 after Buffon had parried a shot from Marcelo.
Manchester United star Javier Hernandez scored twice but missed a last-minute penalty as Mexico defeated Japan 2-1 to leave the Asian side winless at the tournament.
Hernandez took his tally to three as Mexico registered their first victory.
The win, however, came in a 'dead' game after Brazil and Italy had already made sure of their places in the semi-finals as Group A qualifiers.