Mercedes driver Valtteri Bottas grabbed pole position in the Azerbaijan Grand Prix. Photo: Sergei Grits/AP Photo

BAKU Valtteri Bottas took pole position ahead of team-mate Lewis Hamilton as Mercedes secured a front row lockout for Sunday's Azerbaijan Grand Prix.

In treacherous cooling conditions on the demanding Baku street circuit, the Finn produced an outright record lap in one minute and 40.495 seconds to outpace the championship leader and defending world champion by 0.059 seconds.

Sebastian Vettel was third for Ferrari while his team-mate Charles Leclerc, who had been fastest in practice, crashed out when he rammed into a wall, during the Q2 part of a prolonged and incident-hit qualifying session.

The session lasted almost two hours overall after big accidents for both Leclerc and in Q1 for Robert Kubica of Williams.

"I am really happy with that," said Bottas. "It was a nice lap and Ferrari has been really strong. Obviously Charles was out by a mistake and as a team we feel really good to be where we are now. It's all about small margins."

Max Verstappen was fourth for Red Bull ahead of Sergio Perez of Racing Point, Daniil Kvyat of Toro Rosso and British rookie Lando Norris of McLaren.

Antonio Giovinazzi was eighth ahead of Alfa Romeo team-mate Kimi Raikkonen with Leclerc taking 10th despite not running in the session. 

"I am stupid, I am stupid," said Leclerc after his smash into the same wall that claimed Kubica's Williams earlier in the session.

Kubica's accident was further bad news for the luckless Williams team.

On Friday their British rookie driver George Russell escaped unhurt when his car was wrecked after running over a loose drain cover at high speed in opening practice, which was abandoned and cancelled.