Roberto Merhi took pole position for the second Formula Renault 3.5 race at the Hungaroring on a drying track in a dramatic qualifying session.
The Spaniard, who won yesterday's opening race and is closing in on championship leader Carlos Sainz Jr, was the last driver to cross the line, giving him the best of the track conditions.
Only DAMS duo Sainz and Norman Nato had also got an extra lap in before the chequered flag, essentially turning the fight for pole into a three-way scrap.
Sainz beat Merhi's previous benchmark with his final lap and Nato couldn't better it, but a few seconds later Merhi - the championship's in-form man - came out of the final corner to take pole by 0.362s from his title rival.
Race one polesitter Oliver Rowland, who was briefly delayed getting out of the pits when his car failed to fire up, was the quickest of those who did not get an extra lap, leaving him fourth.
Pons Racing locked out the third row of the grid as Oscar Tunjo and Meindert van Buuren capitalised on the conditions, while yesterday's runner-up Pierre Gasly struggled to find clear track and had to settle for seventh.
Gasly had been one of the pacesetters before everybody switched from wets to slicks, but the decisive runs on dry-weather tyres were interrupted by a red flag when Esteban Ocon crashed heavily at Turn 10 with five minutes remaining.
That meant everybody was scrambling to squeeze their laps in at the end, with just three and a half minutes on the clock by the time the first flying laps started.
|1||Roberto Merhi||Zeta Corse||1m37.400s||-|
|2||Carlos Sainz Jr.||DAMS||1m37.762s||0.362s|
|4||Oliver Rowland||Fortec Motorsports||1m39.827s||2.427s|
|5||Oscar Tunjo||Pons Racing||1m39.892s||2.492s|
|6||Meindert van Buuren||Pons Racing||1m40.791s||3.391s|
|7||Pierre Gasly||Arden Motorsport||1m41.001s||3.601s|
|8||Luca Ghiotto||International Draco Racing||1m41.168s||3.768s|
|9||William Buller||Arden Motorsport||1m41.724s||4.324s|
|10||Marco Sorensen||Tech 1 Racing||1m41.733s||4.333s|
|11||Nicholas Latifi||Tech 1 Racing||1m41.995s||4.595s|
|12||Will Stevens||Strakka Racing||1m42.200s||4.800s|
|13||Sergey Sirotkin||Fortec Motorsports||1m42.332s||4.932s|
|14||Roman Mavlanov||Zeta Corse||1m42.504s||5.104s|
|17||Cameron Twynham||Comtec Racing||1m43.307s||5.907s|
|18||Matias Laine||Strakka Racing||1m43.346s||5.946s|
|21||Pietro Fantin||International Draco Racing||1m43.948s||6.548s|
|-||Esteban Ocon||Comtec Racing||1m51.724s||14.324s|