Formula Renault 3.5 championship leader Robin Frijns snatched pole position for the first race of the weekend in Hungary in the final seconds of qualifying.
The Fortec driver, who leads a tight three-way points battle (Sam Bird is five behind and Jules Bianchi six) had set the pace for the majority of the first half of the session at the Hungaroring, responding every time someone knocked him off top spot.
However, he was not really a factor as the fight for pole heated up once everybody took on their second set of new tyres. Then, with just four seconds left on the clock, the Dutchman returned to the top of the timing screens, displacing Carlin's Kevin Magnussen by just 0.028 seconds.
Magnussen had been one of Frijns's biggest challengers in the first half of the session, and the McLaren-backed driver then seemed to have everyone covered as he set two laps good enough for pole in the last five minutes, before the championship leader just slipped ahead.
Bianchi, who lost the first six minutes of the session when he returned to the garage with a right rear puncture after his out-lap, had been giving Magnussen a hard time before Frijns popped up to knock him off the front row. The Ferrari junior driver ended the session just 0.086s shy of top spot.
Arthur Pic was a consistent presence towards the front and took fourth, as he was the only driver to improve at the chequered flag. Behind him, Marco Sorensen and Antonio Felix da Costa will share the third row.
Carlos Huertas briefly looked like a contender for a shock pole when he went fastest with just two minutes left, but the second Fortec driver had to settle for seventh in the end, just ahead of Alexander Rossi.
While Frijns and Bianchi were fighting it out at the front, their fellow title contender Bird had a difficult session, finishing up 10th and seven tenths of a second off the pace.
Home driver Tamas Pal Kiss kept up his free practice form to be the top debutant from this year's GP3 grid, qualifying 16th while GP3 title contenders Daniel Abt and Aaro Vainio were 21st and 26th respectively.
Pos Driver Team Time Gap
1. Robin Frijns Fortec 1m28.520s
2. Kevin Magnussen Carlin 1m28.548s + 0.028s
3. Jules Bianchi Tech 1 1m28.606s + 0.086s
4. Arthur Pic DAMS 1m28.750s + 0.230s
5. Marco Sorensen Lotus 1m28.757s + 0.237s
6. Antonio Felix da Costa Arden Caterham 1m28.816s + 0.296s
7. Carlos Huertas Fortec 1m29.070s + 0.550s
8. Alexander Rossi Arden Caterham 1m29.225s + 0.705s
9. Nico Muller Draco 1m29.230s + 0.710s
10. Sam Bird ISR 1m29.290s + 0.770s
11. Will Stevens Carlin 1m29.348s + 0.828s
12. Mikhail Aleshin RFR 1m29.370s + 0.85 s
13. Lucas Foresti DAMS 1m29.385s + 0.865s
14. Zoel Amberg Pons 1m29.412s + 0.892s
15. Nick Yelloly Comtec 1m29.415s + 0.895s
16. Tamas Pal Kiss BVM Target 1m29.426s + 0.906s
17. Jake Rosenzweig ISR 1m29.430s + 0.910s
18. Kevin Korjus Lotus 1m29.442s + 0.922s
19. Nikolay Martsenko BVM Target 1m29.938s + 1.418s
20. Daniil Move P1 1m30.024s + 1.504s
21. Daniel Abt Tech 1 1m30.057s + 1.537s
22. Andre Negrao Draco 1m30.221s + 1.701s
23. Vittorio Ghirelli Comtec 1m30.308s + 1.788s
24. Yann Cunha Pons 1m30.506s + 1.986s
25. Walter Grubmuller P1 1m30.515s + 1.995s
26. Aaro Vainio RFR 1m31.299s + 2.779s