Jake Dennis collected his fifth pole position of the European F3 season in the first qualifying session at Portimao.
The final driver to emerge on track in the session, the Racing Steps Foundation-backed Briton jumped into the lead in the last minutes.
He managed to improve further on his next lap, ending his run with a time of 1m42.217s.
And Dennis' second flyer turned out to be crucial as Nick Cassidy vaulted up the timesheets in the dying seconds and fell just 0.06s.
The Kiwi driver shuffled Lance Stroll down to third, the Canadian completing an all-Prema Powerteam top three for the first race of the weekend.
Markus Pommer was fourth-fastest, followed by Signature’s Alex Albon and and Van Amersfoort’s title contender Charles Leclerc, while another championship hopeful Felix Rosenqvist couldn't keep pace with his Prema teammates and ended up seventh.
The top ten was completed by three Carlin cars - George Russell, championship leader Antonio Giovinazzi and Red Bull junior Callum Ilott.
Series returnee Alexander Sims qualified 16th, 0.628s off the pace.