With Saturday put aside entirely to the sprint race, qualifying for the grand prix was shifted to Friday for what proved to be a three-way battle for pole with the two Red Bulls of Max Verstappen and Sergio Perez.
In the end, he sealed Ferrari’s first pole of the year with a best time of 1:40.203, nearly two tenths of a second clear of Verstappen, who will join him on the front row, with Perez in third.
Afterwards, Leclerc said: “I’m surprised. We came into the weekend thinking it would be a great weekend if we thought we were ahead of the Mercedes and Aston Martins so it’s a really good surprise.
“It’s going to be difficult to keep the lead. I’m very happy. There’s very little time to practise and you need to be straight on it. The feeling was good from the start.”
It proved a much-needed boost for Ferrari team boss Fred Vasseur following the impending departure of his deputy Laurent Mekies to head up Alpha Tauri later this season.
McLaren had promised a much-improved car in Baku after their difficult start to their season and so it proved with both drivers into Q3 and Lando Norris the best ranked in seventh.
The hour-long qualifying lasted nearly 90 minutes following two red flags in Q1: first when Nick de Vries lost control at turn three and then Pierre Gasly locked the front tyres and hit the barrier.
Verstappen, meanwhile, complained in that opening session of his headrest being loose, which was quickly fixed by his mechanics with no penalty taken by the race stewards.
It proved a qualifying to forget for George Russell, who failed to make it into Q3 by just four thousandths of a second behind teammate Hamilton.