Charles Leclerc saw off Lewis Hamilton to put his Ferrari on pole position for Sunday's Azerbaijan Grand Prix.

Following a frenetic qualifying, which saw four red-flag periods, Leclerc edged out Hamilton by two tenths of a second in Baku, with Max Verstappen third for Red Bull.

Yuki Tsunoda crashed out in the final moments of qualifying which prevented the grid from completing their final runs.

Leclerc said afterwards: "It was quite a s*** lap I thought.

"I made mistakes in two or three corners but I got a big tow of Lewis in the last sector which helped me out a little – but overall we would have been there or thereabouts for pole without the slipstream."

While Leclerc celebrated his second pole in as many races, Hamilton could hardly believe he will start Sunday’s race ahead of Verstappen.

Hamilton’s Mercedes team have been off the pace all weekend, but the seven-time world champion improved as qualifying progressed to start the sixth round on the front row.

"Wow, what an effort," the Mercedes driver said to his team over the radio," later adding: "We definitely were not expecting that.

"This is such a monumental result because we have been struggling all weekend."

In contrast, Red Bull were stunned as Verstappen was unable to post his second lap of Q3 after Tsunoda crashed out at Turn 3 and Carlos Sainz also ran off the circuit, distracted by the Japanese driver’s collision.

"It was just a stupid qualifying," said Verstappen, disappointed that he could not post a final lap following Tsunoda’s crash.

"Everything was working out fine but all this s*** all the time is happening in Q3. It is a street circuit so these things can happen."

Yuki Tsunoda later crashed out

Pierre Gasly is fourth for AlphaTauri with Sainz fifth and Lando Norris sixth. However, Norris faces a trip to the stewards after he remained out on track when the first red flag was issued.

"The lap was OK but we definitely were not expecting that," said Hamilton, four points behind Verstappen. "This is a monumental result for us because we have been struggling all weekend."

Q1 took almost 40 minutes, rather than the scheduled 18 to complete, following two red-flag periods. First, Lance Stroll crashed out in his Aston Martin.

The Canadian driver hit the wall on the exit of Turn 15 with the impact ripping off his front wing.

Following an 11-minute delay, the session restarted but soon it was the turn of Antonio Giovinazzi to fall victim to the 15th bend when he also ended up in the barriers. The two drivers will line up at the back of the grid.

The delays allowed Williams to complete an engine change on George Russell’s car after he broke down in final practice, and the Englishman repaid their impressive efforts by progressing to Q2 and finishing 15th.

Q2 then came to a premature end following the day’s third red flag.

Daniel Ricciardo, who has endured a difficult start to life at McLaren following his off-season transfer from Renault, carried too much speed into the left-handed Turn 3. He crashed into the wall, sustaining serious damage to the front of his car, but the Australian was unharmed in the accident. He will line up only 13th for Sunday’s race.

The off-track animosity between Mercedes boss Toto Wolff and Red Bull team principal Christian Horner is providing an entertaining sideshow, and in the build-up to qualifying, the former called his rival a "windbag who wants to be on camera".

Wolff’s comments came 24 hours after Horner told the Austrian to "keep his mouth shut" as the row over flexible wings intensified.

Mercedes believe Red Bull’s rear wing is handing them an illegal advantage. Countering Wolff’s argument, Horner claimed on Friday that the Silver Arrows could be bending the rules with both their front and rear wings.

"If I were Toto, with the front wing he’s got on his car, I’d keep my mouth shut," said Horner. "If anything, it looks maybe a bit worse than ours."

But in response to his Red Bull rival, Wolff told Sky Sports: "Christian is a bit of a windbag who wants to be on camera. It is easy to be punchy when you are on top of the timesheets but you should be a little bit more modest."

Christian Horner (L) and Toto Wolff

Meanwhile, Hamilton has called for Toto Wolff and Christian Horner to sort out their feud in the ring.

The off-track animosity between Mercedes boss Wolff and his Red Bull counterpart is providing an entertaining sideshow this season.

In the build-up to qualifying for Sunday's Azerbaijan Grand Prix, Wolff, 49, called Horner, 47, a "windbag who wants to be on camera".

The Austrian’s comments came 24 hours after Horner told Wolff to "keep his mouth shut" as the row over flexible wings intensified.

Mercedes believe Red Bull’s rear wing is handing them an illegal advantage.

Countering Wolff’s argument, Horner claimed that the Silver Arrows could be bending the rules with both their front and rear wings.

"If I were Toto, with the front wing he’s got on his car, I’d keep my mouth shut," said Horner. "If anything, it looks maybe a bit worse than ours."

But in response to his Red Bull rival, Wolff said: "Christian is a bit of a windbag who wants to be on camera.

"It is easy to be punchy when you are on top of the timesheets but you should be a little bit more modest."

Hamilton, who finished second in qualifying for Sunday’s race, was then asked for his opinion of the escalating war of words between Wolff and Horner.

"We should get them in the ring," said the seven-time world champion, turning to look at Red Bull’s Verstappen, who will line up one place behind his championship rival in Baku on Sunday.

Verstappen argued that Horner, 5ft 9in, would be at a disadvantage to Wolff, 6ft 3in.

"The weight division will be a bit of a problem with the height and the reach," said the Dutchman.

Hamilton replied: "They are the same weight, just different heights."

The Mercedes driver then added: "They are the two top leaders of the teams and they have contributed hugely to the success of both teams.

"They are going to go head-to-head because we are head-to-head in this title battle but we just like to do our talking on the track so we keep our heads down."

Verstappen, who leads Hamilton by four points heading into Sunday’s race, continued: "It is Formula One and there are a lot of stakes involved.

"Everyone wants to win and everyone is competitive so it is just a natural thing and it is good for everyone to read."