Cape Town - Sebastian Vettel put a Ferrari on pole position at the Hungaroring for the first time since 2005, denying Lewis Hamilton the opportunity to equal Michael Schumacher's pole record.
Qualifying runs with low fuel and fresh supersoft rubber saw the Hungaroring's lap record slashed several times during qualifying on Saturday.
The record was broken twice in Q2, first by Vettel and then Hamilton, before the Ferrari driver slashed it to a 1:16.276 on his opening race in Q3.
While Hamilton struggled with the balance of his W08, Vettel led the way ahead of Valtteri Bottas and Max Verstappen.
Heading out for a second run, a first for Hamilton given that he aborted his earlier lap, the Brit slotted into third place while Bottas improved his team but stayed second.
Vettel was therefore handed an almost pressure-free run to the line and, although he was 0.002s slower than his earlier best, it didn't matter - he was on pole.
It was Ferrari's first pole position at the Hungaroring since Schumacher in 2005.
Kimi Raikkonen made it a Ferrari lock out as he finished P2, 0.168s down, while Bottas and Hamilton dropped to third and fourth.
Verstappen will line up in fifth place ahead of Daniel Ricciardo, Nico Hulkenberg and Fernando Alonso.
Stoffel Vandoorne and Carlos Sainz completed the top ten.
Before the battle for pole position began all eyes were on Williams reserve driver Paul di Resta, called up at the last minute to replace the unwell Felipe Massa.
The 31-year-old, contesting his first F1 qualifying session since 2013, was P19 as he beat Marcus Ericsson by a tenth. He was 0.766s shy of team-mate Lance Stroll.
1 Sebastian Vettel Ferrari 1:16.276
2 Kimi Raikkonen Ferrari 1:16.444 0.168
3 Valtteri Bottas Mercedes 1:16.530 0.254
4 Lewis Hamilton Mercedes 1:16.693 0.417
5 Max Verstappen Red Bull 1:16.797 0.521
6 Daniel Ricciardo Red Bull 1:16.818 0.542
7 Nico Hulkenberg Renault 1:17.468 1.1923
8 Fernando Alonso McLaren 1:17.549 1.273
9 Stoffel Vandoorne McLaren 1:17.894 1.618
10 Carlos Sainz Toro Rosso 1:18.311 2.636
11 Jolyon Palmer Renault 1:18.415
12 Esteban Ocon Force India 1:18.495
13 Daniil Kvyat Toro Rosso 1:18.538
14 Sergio Perez Force India 1:18.639
15 Romain Grosjean Haas 1:18.771
16 Kevin Magnussen Haas 1:19.095
17 Lance Stroll Williams 1:19.102
18 Pascal Wehrlein Sauber 1:19.839
19 Paul di Resta Williams 1:19.868
20 Marcus Ericsson Sauber 1:19.972