Lewis Hamilton captured pole position for Mercedes for the season-opening Australian Grand Prix in a thrilling finish to a rain-hit qualifying session on Saturday, while Formula One champion Sebastian Vettel failed to make the top 10.

Hamilton saved the best for last with his final lap of a gloomy session after Australian Daniel Ricciardo had stormed to the top of 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 greasy Albert Park track was just over three-tenths of a second faster than Ricciardo, who upstaged team mate Vettel to the delight of the home fans.

Quadruple champion Vettel, winner of the last nine races of 2013, was only 13th fastest and was frustrated by a crash late in the final session by Ferrari's Kimi Raikkonen which brought out the yellow flags and forced drivers to ease their pace.

"Today made it so much harder with the conditions, but I'm really happy with the job the team did," said Hamilton, whose 32nd second pole equalled Nigel Mansell's British record. "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.

Ferrari's Fernando Alonso qualified fifth with Jean-Eric Vergne sixth fastest for Toro Rosso.

"The speed is there so we will see what we can do tomorrow" - Sebastian Vettel

It was the first time Vettel had failed to make the final round of qualifying since he started 11th on the grid in Belgium in 2012, before battling through the field to finish the race second.

Vettel will move up to 12th, however, with Williams' Finnish driver Valtteri Bottas due to drop from 10th place after taking a five-place penalty for a gearbox change.

"Obviously tricky conditions, for some reason we had more problems today than we had yesterday," said the 26-year-old German, who appeared to struggle with handling and survived a brush with a wall in the first qualifying session.

"The speed is there so we will see what we can do tomorrow. It's a long race, anything can happen."

With Red Bull still playing catch-up to Mercedes after an abysmal winter testing plagued by reliability problems with their Renault power unit, Vettel looks set to be beaten for the first time since Hamilton won in Hungary last July.

Ricciardo, who has shouldered Australia's hopes since the retirement of his Red Bull predecessor Mark Webber at the end of last season, had few illusions about the gap between the teams.

"I think if it was a dry qualifying we were expecting Lewis and Nico to be on the front row," the 24-year-old said.

"Hopefully the upward trend continues and we can start to hassle these guys in dry conditions soon."

With teams already struggling to master the new turbocharged hybrid engines, fuel consumption will add an additional layer of complexity for drivers in Sunday's race, with a new rule limiting cars to 100 kilograms of petrol.

Vettel will be in esteemed company in the middle of the grid, with two other champions - McLaren's Jenson Button and Raikkonen - also failing to get into the final group of 10.

Briton Button qualified 11th but will start 10th, while  Raikkonen, the 2007 world champion, was 12th fastest on his first Saturday since returning to Maranello.

The Finn, winner in Melbourne with Lotus last year, crashed into the wall at turn 14.

Russian rookie Daniil Kvyat also enjoyed a positive qualifying debut, despite hitting the wall at the end of the final session, to line up eighth for Toro Rosso with Force India's Nico Hulkenberg seventh.

Brazilian Felipe Massa will start ninth on the grid in his first race since crossing to Williams from Ferrari.

Japan's Kamui Kobayashi, making his comeback after being dropped by Sauber at the end of 2012, gave lowly Caterham a boost by qualifying 15th - which will become 14th after Bottas drops down.

Lotus's horror week continued as both Frenchman Romain Grosjean and Venezuelan Pastor Maldonado were among the six knocked out of the first session.

Grosjean locked up and spun off after posting the slowest lap time in the opening session, while Maldonado was unable even to trouble the timesheets due to a problem with the power unit and will rely on the stewards' discretion for a Sunday start.

"We had a lot of problems today and every time we fixed one another one comes along," said Grosjean. "It's frustrating, but I'm the one who has the easiest life as I'm not working all night on the car."

Sauber's Mexican driver Esteban Gutierrez, who qualified 19th, also collected a five-place grid penalty for the race for having a new gearbox.