Nico Rosberg has beaten Lewis Hamilton to pole position for the Hungarian Grand Prix after prevailing in a hugely eventful qualifying session defined by initial torrential rain, repeated interruptions and a dramatic climax on a drying track.

With the session concluding almost two hours after qualifying was supposed to get underway, stormy weather in the lead up to Q1 would subsequently wreak havoc as three crashes and four red flag periods dragged the first knockout phase out for 70mins.

Nevertheless, with the rain passing by the time Q2 and Q3 were underway, the deciding session would take place on a dry circuit and come down to a thrilling last gasp effort for the final ten in the optimal conditions, with Lewis Hamilton seemingly well on course as he posted a 'purple' sector one only to encounter a spun Fernando Alonso at Turn 8, forcing him to back off.

F1 RESULTS: Hungarian Grand Prix Qualifying Results

With almost every driver heeding the warning to back off, only Rosberg would keep up the pace, a decision that would prove savvy as Alonso had moved by the time he had reached Turn 8. Weaving between the traffic, Rosberg would hold it together to cross the line with a 1min 19.965s lap, two tenths up on his hindered Mercedes team-mate.

Despite the unusual circumstances, the qualifying order followed the usual script with both Mercedes' on the front row, ahead of Red Bull's Daniel Ricciardo in third and Max Verstappen fourth, the Dutchman losing out on a potential pole position challenge after failing to get around to the finish line in time to start his final flyer.

Sebastian Vettel heads up row three as Ferrari got only one of its cars into Q3, with Carlos Sainz starting alongside him in the best of the Toro Rossos.

With no other driver beyond Rosberg able to improve on their final lap, ironically Alonso's spin would see him hold onto seventh place - the best McLaren starting position since 2014 -, while Jenson Button gets away alongside him in eighth. Nico Hulkenberg and Valtteri Bottas complete the top ten.

With soaring temperatures reaching as high as 35 degrees for FP3 just two hours before qualifying, a storm would subsequently bubble up in the area to bring heavy rain with little more than an hour to go before qualifying.

Causing initial delays to Q1 due to standing water, the session eventually got underway after a wait of 20mins only to be halted five minutes later on safety grounds after rain intensified again. Restarting again after a 20mins hiatus, a crash for Marcus Ericsson at Turn 10 would see red flags deployed again, only for Felipe Massa to slide off at Turn 4 to cause a third stoppage just seconds after it had restarted.

With the rain having stopped and the track evolving, the session was stopped definitively with 1min 18secs remaining when Rio Haryanto mirrored Ericsson's smash by spinning at Turn 10. Regardless, despite only a handful of representative lap times coming in the improving conditions before the fourth red flag, Jolyon Palmer, the sidelined Massa, Kevin Magnussen, Ericsson, Pascal Wehrlein and Haryanto ended up as fairly familiar Q1 casualties.

With a dry line forming in the increasingly warm weather, Q2 would mirror Q3 from the Austrian Grand Prix as the fastest lap times were dictated by whomever was last across the line before the chequered flag. Almost catching out tenth place Hamilton after he ran wide at Turn 1, only to recover the ground in sectors two and three, Kimi Raikkonen - the first to take the flag - was less fortunate.

Barrelling down the timesheets as those improved behind him, he will start the Hungarian Grand Prix in 14th position, behind Romain Grosjean in 11th, Danil Kvyat in 12th and Sergio Perez in 13th. Esteban Gutierrez and Felipe Nasr share row eight in 15th and 16th.