Goals from Adriano and substitute Fred sealed Brazil's place in the last 16 with a win over a gallant Australia.
The Socceroos' well-organised defence frustrated Brazil until Ronaldo squared for Adriano to score from 18 yards.
Harry Kewell blasted over an unguarded goal and Mark Viduka's lob landed on top of the net as Australia battled back and came close several times.
But Fred tapped home the second for the unconvincing holders after fellow sub Robinho's shot came back off the post.
Their second win sees them almost stumble through to the knockout stages.
But on a day Australian football came of age, the Socceroos need only a draw in their final game against Croatia to seal a place in the last 16.
Ronaldo started again for Brazil despite ongoing criticism over his performances and condition.
His first contribution in this game saw him lose control of an Emerson pass but his second was a delight as he flicked the ball over his head for Kaka to crash a volley inches wide.
Vince Grella's foul on Ronaldo gave Brazil's troupe of free-kick artistes an early chance to convene but Roberto Carlos's blast swung high and wide.
Typically there was no shortage of confidence from Australia and tactically manager Guus Hiddink had done his homework, detailing Jason Culina and Mile Sterjovski to close off the flanks to negate the threat of Carlos and Cafu.
Australia defended dutifully, marshalled by Craig Moore whose superbly-timed challenge only increased Ronaldo's frustration as he had a sight of goal.
Ronaldo picked up a needless booking for putting the ball in the net after being pulled back for offside and when presented with a chance by Kaka's chipped pass, completely missed his kick in front of goal.
It took Brazil just three minutes of the second half to forge the breakthrough as Australia switched off defensively for the first time.
Ronaldo looked offside as he collected a through pass but he squared the ball for Adriano who took advantage as Scott Chipperfield failed to close quickly enough to score left-footed from 18 yards.
Australia were presented with a golden chance as Dida dropped a cross but substitute Kewell blazed over the unguarded goal.
Kewell then almost embarrassed Dida, dipping a 40-yard shot inches over the bar after spotting the keeper off his line.
Australia went for broke but Robinho, on for the disappointing Ronaldo, almost punished them on the break, nicking the ball over keeper Mark Schwarzer and onto the roof of the net.
At the other end Dida went full length to claw away Mark Breschiano's volley, while Kaka thumped a header against the bar from a corner.
Viduka's lob left Dida stranded but agonisingly landed on the roof of the net and as Australia threw everything forward in search of an equaliser they had Brazil on the rack.
But substitute Fred sealed victory with a second goal to flatter Brazil, tapping home after Robinho's shot came back off the post.
Brazil: Dida, Cafu, Lucio, Juan, Carlos, Kaka, Emerson (Gilberto 72), Ze Roberto, Ronaldinho, Ronaldo (Robinho 72), Adriano (Fred 88).
Subs Not Used: Cicinho, Cris, Julio Cesar, Juninho, Luisao, Mineiro, Ricardinho, Rogerio, Silva.
Booked: Cafu, Ronaldo, Robinho.
Goals: Adriano 49, Fred 90.
Australia: Schwarzer, Moore (Aloisi 69), Popovic (Bresciano 40), Neill, Chipperfield, Emerton, Grella, Sterjovski, Cahill (Kewell 56), Culina, Viduka.
Subs Not Used: Beauchamp, Covic, Kalac, Kennedy, Lazaridis, Milligan, Skoko, Thompson, Wilkshire.
Booked: Emerton, Culina.
Referee: Markus Merk (Germany).
Fifa man of the match: Ze Roberto