Sebastian Vettel held on for a third consecutive pole position after a mistake from Kimi Raikkonen saw P1 slip away from the Finn at the last moment.
Vettel was on provisional pole with a 1:41.498, which proved to be enough despite Raikkonen being two tenths up on his team-mate on the final attacking lap.
Raikkonen lost the rear due to the tailwind at Turn 16 and scrubbed off all his hard work and was forced to settle for P6 on Sunday’s grid instead.
Joining Vettel on the front row is Lewis Hamilton, who improved to within a tenth of his rival, while Valtteri Bottas rounded off the top three, three tenths back.
Daniel Ricciardo and Max Verstappen will line up P4 and P5 respectively, with Esteban Ocon, Sergio Perez, Nico Hulkenberg and Carlos Sainz completing the top 10.
Hulkenberg will fall five places from P9, though, due to a gearbox change ahead of qualifying.
Qualifying promised to be a rather hectic affair with track temperature dropping and the wind continuing to pick up in the Azerbaijan capital.
And the yellow flags were soon waving as Romain Grosjean’s qualifying came to an abrupt end after just four minutes, unable to select the right gear and told to turn the engine off soon after.
It was Raikkonen who set the early pace in Q1, with Verstappen and Hamilton both within a tenth of the Finn.
There was more drama further down the field, though, with Pierre Gasly having to swerve dramatically to avoid his slow team-mate Brendon Hartley, who had picked up a puncture, and ruining the Frenchman’s qualifying in the process.
Joining the two Toro Rosso cars and Grosjean on the sidelines were Sauber’s Marcus Ericsson and the McLaren of Stoffel Vandoorne.
The fight for the top 10 shoot-out then got underway and Raikkonen found himself in the danger zone after not being able to set a clean lap on the first two attempts, forced to use the escape roads on both occasions.
Ahead of the final hot-laps in Q2, Hamilton and Bottas were separated by a mere 0.003 seconds with Verstappen in P3, two tenths behind.
Raikkonen was able to keep it clean as the clock ticked down, and shot all the way up to top spot after finding an extra tenth on Hamilton and Bottas.
Meanwhile, settling for a starting place outside of the top 10 were Lance Stroll, Sergey Sirotkin, Fernando Alonso, Charles Leclerc and Kevin Magnussen.
The battle for pole commenced with Vettel laying down a huge marker with a 1:41.498, three tenths quicker than his nearest rival Hamilton.
A mistake from Raikkonen at Turn 16, meant he had nine tenths to find from P6 to get himself in contention on the final hot laps in the Baku evening.
The two Mercedes cars were first to try and hunt down Vettel and Hamilton was marginally in front of Vettel in the first sector, but lost two tenths in the second sector. He improved on his initial lap but only closed to within a tenth.
All eyes turned to Raikkonen, who was two tenths up on Vettel who had suffered a big lock-up on his final lap. However, Raikkonen undid all his hard work at Turn 16, lost the back end of the car, and found no improvement.
Pole slipping away from his grasp once again.
1 Sebastian Vettel Ferrari 1:41.498
2 Lewis Hamilton Mercedes 0.179s
3 Valtteri Bottas Mercedes 0.339s
4 Daniel Ricciardo Red Bull 0.413s
5 Max Verstappen Red Bull 0.496s
6 Kimi Raikkonen Ferrari 0.992s
7 Esteban Ocon Force India 1.025s
8 Sergio Perez Force India 1.049s
9 Nico Hulkenberg Renault 1.568s
10 Carlos Sainz Renault 1.853s
11 Lance Stroll Williams
12 Sergey Sirotkin Williams
13 Fernando Alonso McLaren
14 Charles Leclerc Sauber
15 Kevin Magnussen Haas
16 Stoffel Vandoorne McLaren
17 Pierre Gasly Toro Rosso
18 Marcus Ericsson Sauber
19 Brendon Hartley Toro Rosso
20 Romain Grosjean Haas no time