Lewis Hamilton has won pole position for Mercedes for the season-opening Australian Grand Prix in a thrilling finish to a rain-hit qualifying session today.

Hamilton saved the best for last with his final lap after Australian Daniel Ricciardo had topped the timesheets only seconds earlier on his first race weekend for champions Red Bull.

The 29-year-old Briton's time of one minute 44.231 seconds on a wet Albert Park track was just over three-tenths of a second faster than Ricciardo, who upstaged quadruple world champion team mate Sebastian Vettel to delight the home fans.

Vettel, winner of the last nine races of 2013, set only the 13th best time.

''Today made it so much harder with the conditions, but I'm really happy with the job the team did,'' said Hamilton.

''These cars are much harder driving in the wet.''

Mercedes' Nico Rosberg will start third on the grid alongside McLaren's 21-year-old Danish rookie Kevin Magnussen, who underlined his talent with a poised drive in trying conditions.