Valtteri Bottas will start the Azerbaijan GP from pole position, ahead of Lewis Hamilton, while Pierre Gasly has twice been sent to the back of the grid.
In a qualifying session where many expected Ferrari to romp away with it, Mercedes bagged the 1-2 with Bottas edging team-mate Hamilton.
Sebastian Vettel, the best placed Ferrari driver, will line up third ahead of Max Verstappen in the Red Bull.
The Dutchman’s team-mate Pierre Gasly is at the very back of the grid, in fact he is starting from the pit lane.
Gasly was handed a pit lane start on Friday when he missed the weighbridge in practice and was then excluded from qualifying on Saturday over a fuel flow violation.
He will be joined by Robert Kubica, who crashed in qualifying, in the pit lane, with Williams opting to make further set-up changes not permitted under parc ferme conditions.
Kimi Raikkonen became the third driver to start from the pit lane after his Alfa Romeo’s front wing deflected more than 5mm allowed by regulations and thus disqualified him from the qualifying results.
The revised grid
1 Valtteri Bottas
2 Lewis Hamilton
3 Sebastian Vettel
4 Max Verstappen
5 Sergio Perez
6 Daniil Kvyat
7 Lando Norris
8 Kimi Räikkönen
9 Carlos Sainz
10 Daniel Ricciardo
11 Alexander Albon
12 Kevin Magnussen
13 Lance Stroll
14 Romain Grosjean
15 Nico Hulkenberg
16 George Russell
17 Antonio Giovinazzi *
18 Robert Kubica**
19 Kimi Raikkonen***
20 Pierre Gasly ****
*Giovinazzi penalised 10 places for third control electronics
** Kubica to start from pit lane, set-up changes made outside of parc ferme regulations
*** Raikkonen to start from pit lane, excluded from qualy for front wing violation
**** Gasly to start from pit lane, excluded from qualy for a fuel flow violation