Hungarian Grand Prix qualifying results: Confirmed grid - Hamilton on pole, Ricciardo 12th

Mercedes' Valtteri Bottas and Ferrari's Kimi Raikkonen, who were running in second and third place, respectively, when Vettel crashed, finished the race in second and third, as they came into the pits during the safety vehicle period while Hamilton, who was running in fourth when Vettel crashed, stayed out on the track to inherit the race lead before going on to win.

Daniel Ricciardo was counting on launching his Hungarian Grand Prix from the front row, but bad luck and the elements will put the Red Bull driver a lowly P12 on Sunday's grid.

Behind the top three, with Mercedes' Valtteri Bottas in sixth, Haas driver Romain Grosjean was best of the rest, jumping ahead of Renault's Nico Hulkenberg at the end of the session.

"It was dry for a part of the lap and then wet".

Vettel, also quickest in second practice on Friday, set a track record of 1 minute 16.170 seconds as he looks to recover from last weekend's title blow in Germany.

Speaking to Sky Sports after the session, team boss Toto Wolff echoed Hamilton's sentiments. "Tomorrow I will have a fight on my hands", said Ricciardo. We'll do the normal things and see where we come out.

Formula 1: Do Ferrari really have an advantage over Mercedes?

Vettel had been quickest in both the first and second phases of qualifying but Mercedes got their timing right when it mattered.

"When he came on the radio and said you have one lap to make the different, I think I was four-tenths behind Kimi at the time, and then Valtteri pushed ahead of me so he went on pole and then I was able to".

It's a tough balancing act, though, because even though Hamilton says Mercedes will "park the bus", they can't run too slowly they can't run too slowly given the up-to 0.4s pace advantage Ferrari and Red Bull showed on Friday.

The German's team-mate Carlos Sainz was next, ahead of Haas' Kevin Magnussen, Toro Rosso's Pierre Gasly and McLaren's Fernando Alonso.

The Briton, who has won five times in Hungary but never in a championship year, suffered a big slide into the chicane on the dusty asphalt in the morning.