Championship leader Nico Rosberg collected pole position during a dramatic wet/dry qualifying session for the Hungarian Grand Prix.
Rosberg took top spot with a 1:19.965 as Mercedes team-mate Lewis Hamilton had to back off when Fernando Alonso spun at Turn 9.
Alonso cleared his car by the time Rosberg arrived and he was able to snatch top spot from Hamilton, who had been almost four-tenths clear in the first sector before he had to slow.
The start of qualifying was delayed by 20 minutes after a torrential storm struck the circuit over the lunch break.
Once the session began, there was frantic jostling for position before proceedings were halted when the heavy rain fell once more.
At this stage Rosberg and Hamilton occupied only 20th and 21st in the standings, but their precarious position was alleviated by the decision to halt the session due to the inclement conditions.
When the session resumed, after a 15-minute wait, it was punctuated by further stoppages, as Marcus Ericsson crashed at Turn 10 while Felipe Massa went off on an out lap on Intermediate tyres at Turn 4.
Manor driver Rio Haryanto ultimately brought Q1 to an early end, with a minute left on the clock, when he went off at Turn 10.
Haryanto’s crash prevented several drivers from improving, leaving Jolyon Palmer to rue another Q1 elimination in 17th place, with Kevin Magnussen also eliminated in 19th spot.
They were split by Massa, courtesy of his pre-crash time, with Ericsson in 20th, in front of Pascal Wehrlein and Haryanto.
The circuit dried sufficiently for slick tyres to be used during the closing stages of Q2 with Williams’ Valtteri Bottas the first to gamble on Super Softs.
His rivals followed and there was a scare for Hamilton as a poor first sector, caused by running deep into Turn 1, left him at risk while rivals improved on a drying track.
Hamilton ultimately wound up 10th, scraping through to Q2 by just a tenth of a second.
That left Romain Grosjean eliminated in 11th place, with Daniil Kvyat 12th and Sergio Pérez 13th.
Ferrari’s Kimi Räikkönen was caught out by the track improvements and languished down in 14th, with Esteban Gutiérrez 15th and Felipe Nasr 16th, the Sauber driver having briefly led the way in Q1.
When Q3 got underway it was Hamilton who initially led the charge, edging out Rosberg, before the German driver moved ahead amid Alonso’s spin.
Red Bull presented the biggest threat to Mercedes as Daniel Ricciardo took third, with Max Verstappen fourth, having missed out on his final flying lap.
Sebastian Vettel was fifth, frustrated by traffic, while Carlos Sainz Jr. took sixth, ahead of Alonso and McLaren team-mate Jenson Button.
Nico Hülkenberg and Valtteri Bottas completed the top 10.