Nico Rosberg will take pole position for the Hungarian Grand Prix after claiming top spot in qualifying by 0.486s.
Lewis Hamilton failed to make the grid after he was forced to withdraw after an engine fault saw his Mercedes burst into flames at the Hungaroring.
Sabastian Vettel came in second, while Valtteri Bottas and Daniel Ricciardo finished third and fourth respectively.
Rosberg told BBC Sport: "Qualifying three was a really big challenge, the track was changing all time at the beginning. Starting the lap, I was the first one to arrive at the first corner, it was difficult to judge.
"It was very, very wet so I did take it a bit easy and I managed to avoid crashing. It was just massively difficult down there.
"From then on, it was easier as it started drying again. My last lap, it was nice to nail it."
Full standings:
1. Nico Rosberg (Mercedes)
2. Sebastian Vettel (Red Bull)
3. Valtteri Bottas (Williams)
4. Daniel Ricciardo (Red Bull)
5. Fernando Alonso (Ferrari)
6. Felipe Massa (Williams)
7. Jenson Button (McLaren)
8. Jean-Eric Vergne (Toro Rosso)
9. Nico Hulkenberg (Force India)
10. Kevin Mangussen (McLaren)
11. Daniil Kvyat (Toro Rosso)
12. Adrian Sutil (Sauber)
13. Sergio Perez (Force India)
14. Esteban Gutierrez
15. Romain Grosjean (Lotus)
16. Jules Bianchi (Marussia)
17. Kimi Raikkonen (Ferrari)
18. Kamui Kobayashi (Caterham)
19. Max Chilton (Marrusia)
20. Marcus Ericsson (Caterham)
21. Lewis Hamilton (Mercedes)
22. Pastor Maldonado (Lotus)