Oscar Piastri carried McLaren's Bahrain Grand Prix practice domination through to pole position, but his Formula 1 world championship leading team-mate Lando Norris was only sixth fastest.
Mercedes duo George Russell and Kimi Antonelli initially qualified in second and fourth but both were handed one-place grid penalties for a red flag breach.
Mercedes sent the drivers to the end of the pitlane when the estimated restart time was issued rather than the finalised restart time, leading to a grid drop.
That puts Leclerc's Ferrari onto the front row alongside Piastri and moves Pierre Gasly's Alpine into fourth.
1 Oscar Piastri (McLaren)
2 Charles Leclerc (Ferrari)
3 George Russell (Mercedes)
4 Pierre Gasly (Alpine)
5 Kimi Antonelli (Mercedes)
6 Lando Norris (McLaren)
7 Max Verstappen (Red Bull)
8 Carlos Sainz (Williams)
9 Lewis Hamilton (Ferrari)
10 Yuki Tsunoda (Red Bull)
11 Jack Doohan (Alpine)
12 Isack Hadjar (Racing Bulls)
13 Fernando Alonso (Aston Martin)
14 Esteban Ocon (Haas)
15 Alex Albon (Williams)
16 Nico Hulkenberg (Sauber)
17 Liam Lawson (Racing Bulls)
18 Gabriel Bortoleto (Sauber)
19 Lance Stroll (Aston Martin)
20 Ollie Bearman (Haas)