Ferrari's championship leader Sebastian Vettel has grabbed pole position for the Azerbaijan Grand Prix, his third consecutive pole this season.
The German will be at the front of the grid for Sunday's street race after setting a best lap of 1 minute 41.498 seconds and edging world champion Lewis Hamilton into second in his Mercedes.
Mercedes driver Valtteri Bottas qualified third on the banks of the Caspian Sea with Red Bull's Daniel Ricciardo, last year's winner in Baku and victorious in Shanghai two weeks ago, fourth fastest.
Vettel, who won the first two races of the season, leads Hamilton by nine points after three grands prix this year.
"It will be an intense race, safety cars are very likely. Our car was really good this afternoon," Vettel said.
"Yesterday I struggled with confidence and trust in the car, which is important. We got pole so I can't be much more happy."
Vettel had been fastest in final practice as wind caused problems earlier on Saturday but Ricciardo was quickest in second practice on Friday after Bottas had the best of the first session.
Hamilton, who has won three of the last four titles, said Mercedes had a job on their hands on Sunday.
"Sebastian did a good job, they were quickest. They have a phenomenal car this year, but we are in the mix and I'll try to give Sebastian a hard time tomorrow," he added.
Max Verstappen qualified fifth in his Red Bull while Kimi Raikkonen, fastest in Q1 and Q2, had to be content with sixth place on the grid after a skid hit his chances of a quicker time.
Esteban Ocon and Sergio Perez from Force India were seventh and eighth fastest on the twisting street circuit, which passes Baku's varied medieval and 21st-century architecture.
Renault's Nico Hulkenberg qualified ninth but will be hit with a five-place grid penalty for switching his gearbox.