Championship leader Sebastian Vettel has laid down the title gauntlet to Lewis Hamilton after beating his rival to pole position in Azerbaijan.

Vettel, nine points clear of Hamilton in the standings, finished 0.179 seconds clear of the Mercedes driver to secure his third pole in as many races.

Hamilton arrived in Baku without a victory from the opening three races, but against the backdrop of Bernie Ecclestone's claim that the Brit is no longer the racer he once was, he will be relieved to start alongside Vettel on the front row.

Hamilton also out-qualified his Mercedes team-mate Valtteri Bottas for the first time since the season-opening race in Australia. Bottas lines up in third.

Hamilton, 33, has been sluggish in recent grands prix, leading Formula One's former overlord Ecclestone to suggest the sport's defending champion was "fed up" and "not the racer he was".

But the Mercedes driver, who has not tasted victory since October's United States Grand Prix, delivered a response of sorts to qualify alongside Vettel.

Vettel, 30, proved too good for Hamilton with his opening flying lap at the Baku City Circuit enough to take the spoils.

In the closing moments, Vettel's Ferrari team-mate Kimi Raikkonen appeared on course to take his first pole in nearly a year only to make a mistake in the final sector and cross the line sixth fastest.

Daniel Ricciardo, a winner last time out in China and here in Azerbaijan last year, will line up in fourth, one place ahead of his Red Bull team-mate Max Verstappen.

Lewis Hamilton will start on the front row of the grid

"That was close and we did the best job we could," Hamilton said. "I lost a little bit in the last sector but Sebastian did a good job and they have a phenomenal car this year.

"We are in the mix. This is the fifth best track to overtake so I am going to try and give Sebastian a hard time tomorrow."

Vettel added: "It will be an intense race as anything can happen with the safety cars. Our car was good this afternoon so we should be in a good place tomorrow.

"When it clicks it keeps coming and it was really enjoyable. We got pole so we can't be much happier with the way the day went."

McLaren's poor campaign continued with Stoffel Vandoorne failing to make it out of the opening phase. The Belgian will start from 16th while Fernando Alonso could manage only 13th.

Tim Goss was removed from his position as the team's chief technical officer earlier this week, and further managerial changes could be forthcoming.

Racing director Eric Boullier bore a concerned expression in McLaren's hospitality suite in the moments before qualifying, and his mood is unlikely to have improved following yet another dismal showing.