Bottas, in his third race for Mercedes after being drafted in to replace world champion Nico Rosberg, hit top spot on his final run to edge out Hamilton by just 0.023 seconds.
"Valtteri is keeping me on my toes - he really deserved that lap," said Hamilton, who lost time in the second sector and at the final corner on his final lap.
"A first pole position, it is just amazing - you dream that as a kid and tomorrow could be his first GP win ever.
"He did a great job."
Bottas became the fifth Finn to take a Formula 1 pole position, after Keke Rosberg, Mika Hakkinen, Kimi Raikkonen and Heikki Kovalainen.
It comes on the back of a difficult weekend in China, where he spun behind the safety car before recovering to salvage sixth.
"Obviously very happy," he said. "It is the first pole in my career - it took a few races but we got it and hopefully it is the first of many.
"I definitely now feel much more comfortable in the car with the car than qualifying in Melbourne.
Read the full article on eurosport.co.uk: Hamilton: Bottas keeping me on my toes