Nico Rosberg produced a blistering last gasp effort to secure pole position in a rain-affected qualifying for the Hungarian Grand Prix.
The Mercedes driver seemed destined to start Sunday's race from second on the grid before he clocked a 1:19.965s on his final run to claim the top spot.
Rosberg's lap arrived following a spin for McLaren's Fernando Alonso late in Q3 which brought out the yellow flags.
Replays showed that the championship leader did lift during the incident zone in the second sector.
Alonso's spin on a damp section of track forced Lewis Hamilton to back off on his final lap, leaving the reigning world champion in second 0.143s adrift of his team-mate.
The Brit was quicker on his final lap before he was forced to lift.
Red Bull Racing's Daniel Ricciardo provided one his best qualifying performances of the season to secure third just 0.3s shy of Rosberg.
The Australian was also hampered by Alonso's mistake as he was forced to abandon a personal best lap.
Ricciardo will share the second row with his team-mate Max Verstappen.
“We got hurt by the yellow. I was quite angry because I was up on that lap and it would have put me closer to pole,” said Ricciardo.
“I think the session went well and we were competitive in all conditions.”
Heavy rain had delayed qualifying by 20 minutes with the treacherous conditions then causing four red flags in Q1, which took more than a hour to complete.
Conditions dried rapidly in Q2 which allowed the top 10 to run slicks for the final part of qualifying.
Ferrari's Sebastian Vettel could only manage a time good enough for fifth ahead of Toro Rosso's Carlos Sainz.
McLaren put on a strong display as Alonso and Jenson Button progressed to Q3, with the pair locking out the fourth row.
Force India's Nico Hulkenberg and Williams' Valtteri Bottas completed the top 10.
Kimi Raikkonen emerged as the surprise scalp in Q2 as the Ferrari driver misjudged his run on a rapidly drying track.
The Finn had topped the times but in the end missed out on the top 10.
He will start Sunday's race from 14th behind Romain Grosjean (Haas F1), Daniil Kvyat (Toro Rosso) and Sergio Perez (Force India).
Esteban Gutierrez and Felipe Nasr completed the group of drivers eliminated in Q2.
Both Renaults failed to progress from an eventful Q1 with Jolyon Palmer and Kevin Magnusen unable to improve as the red flags flew for fourth time in the session.
Williams' Felipe Massa will start from 18th on the grid following a crash with five minutes of Q1 remaining, which brought out the red flags.
Marcus Ericsson (Sauber) was another driver to see his qualifying cut short as he crashed once qualifying resumed after the first red flag caused by heavy rain.
He will start from 20th ahead of the Manors of Pascal Wehrlein and Rio Haryanto, with the latter causing the fourth red flag that saw Q1 end prematurely.
Result: Formula 1 Hungarian Grand Prix Qualifying
Position | Driver | Car | Time | Gap |
---|---|---|---|---|
1 | Nico Rosberg | Mercedes | 1:19.965s | – |
2 | Lewis Hamilton | Mercedes | 1:20.108s | +0.143s |
3 | Daniel Ricciardo | Red Bull/Renault | 1:20.280s | +0.315s |
4 | Max Verstappen | Red Bull/Renault | 1:20.557s | +0.592s |
5 | Sebastian Vettel | Ferrari | 1:20.874s | +0.909s |
6 | Carlos Sainz | Toro Rosso/Ferrari | 1:21.131s | +1.166s |
7 | Fernando Alonso | McLaren/Honda | 1:21.211s | +1.246s |
8 | Jenson Button | McLaren/Honda | 1:21.597s | +1.632s |
9 | Nico Hulkenberg | Force India/Mercedes | 1:21.823s | +1.858s |
10 | Valtteri Bottas | Williams/Mercedes | 1:22.182s | +2.217s |
11 | Romain Grosjean | Haas/Ferrari | 1:24.941s | Q2 |
12 | Daniil Kvyat | Toro Rosso/Ferrari | 1:25.301s | Q2 |
13 | Sergio Perez | Force India/Mercedes | 1:25.416s | Q2 |
14 | Kimi Raikkonen | Ferrari | 1:25.435s | Q2 |
15 | Esteban Gutierrez | Haas/Ferrari | 1:26.189s | Q2 |
16 | Felipe Nasr | Sauber/Ferrari | 1:27.063s | Q2 |
17 | Jolyon Palmer | Renault | 1:43.965s | Q1 |
18 | Felipe Massa | Williams/Mercedes | 1:43.999s | Q1 |
19 | Kevin Magnussen | Renault | 1:44.543s | Q1 |
20 | Marcus Ericsson | Sauber/Ferrari | 1:46.984s | Q1 |
21 | Pascal Wehrlein | Manor/Mercedes | 1:47.343s | Q1 |
22 | Rio Haryanto | Manor/Mercedes | 1:50.189s | Q1 |