On board his factory Yamaha, Rossi edged out fellow Italian Andrea Iannone and Spain???s Dani Pedrosa, as world champion Marc Marquez had to settle for a spot on the second row.
Marquez eventually qualified down in fifth place, behind his compatriot Jorge Lorenzo who took fourth.
Rossi – who won the Australian Grand Prix last month – posted a fastest lap of one minute 30.843 seconds to land his first pole since Le Mans back in 2010.
The Italian is battling with Yamaha team-mate Lorenzo to finish as runner-up behind Marquez in the world championship and was delighted, and a little surprised, by his achievement.
“We were still in black and white I think (when he was last on pole),” Rossi joked with reporters afterwards.
“On the last lap I felt that I could improve and then to look up at the screen and see I was on pole was fantastic.”
Marquez is attempting to surpass the record of 12 wins in a season he shares with Australian great Mick Doohan this weekend, but saw his momentum halted by a crash in the final session.
British duo Bradley Smith and Cal Crutchlow qualified in seventh and eighth respectively.