The 35-year-old Italian, who is second in the championship standings, won the 27-lap race from eighth on the grid. World champion Marc Marquez looked to be coasting to victory when he went off on a corner with 10 laps remaining.
Bradley Smith was third, his first podium finish, after fellow Briton Cal Crutchlow crashed out on the final lap when sitting second. That completed the first all-Yamaha podium since Le Mans 2008.
An emotional Smith, who has been on the rostrum 23 times in the smaller classes of motorsport, is in only his second year of MotoGP and the 23-year-old said of his third place: "It's unbelievable."
Rossi finished 10 seconds ahead of Spain's Jorge Lorenzo to secure his sixth win in Australia, and first since 2005.
It was the 108th victory of the Yamaha rider's career - and his 82nd in MotoGP or its predecessor 500cc class, which is the most by any rider.
Dani Pedrosa, joint second with Rossi in the standings going into the race, retired due to bike damage after being clipped by Andrea Iannone.
Marquez, who won the world title in Japan last week, was attempting to equal Mick Doohan's 1997 record of 12 premier-class GP wins in a single season and was four seconds clear when he slid off on lap 18.
He was not seriously injured and said of his crash: "I don't know what happened. I was pushing all the time."
Read more: