Championship leader Sebastian Vettel took pole position for the Azerbaijan Grand Prix ahead of Mercedes duo Lewis Hamilton and Valtteri Bottas, Vettel’s teammate Kimi Raikkonen, who set two fastest sectors on his final lap before making an error at Turn 15 and losing a second in the final sector, finally set six fastest lap-time.

The German still had enough pace to fend off the challenge from Mercedes, with a 0.179s margin over Hamilton and a 0.339s advantage over Valtteri Bottas in third.

Red Bulls duo Daniel Ricciardo and Max Verstappen to locked fourth and fifth on the grid ahead of the second Ferrari.

Force India made the best qualifying result of its season with Esteban Ocon in seventh and Sergio Perez in eighth. The two teammates were split by just 0.024s and Ocon was only 0.033s off Raikkonen’s messy lap in the Ferrari.

Renault duo rounded off the top ten with Nico Hulkenberg 0.285s ahead of teammate Carlos Sainz.

Saturday’s cooler, windy conditions seemed to favor Vettel and Ferrari, who had struggled for grip in Friday practice.

“When it clicks, it just keeps coming and it was really enjoyable,” Vettel said.

Baku’s tight corners and narrow streets mean any incidents in the race will likely mean the safety car comes out and could offer chances for drivers starting further back.

“I think it will be an intense race,” Vettel said. “Anything can happen, safety cars are very, very likely.”

Hamilton promised a tough race.

“We did the best job we could. It was very, very close,” Hamilton said. “We’re going to try to give Sebastian a hard time tomorrow.”

Vettel’s teammate Kimi Raikkonen was heading for pole position until he slid the car. He qualified sixth.

Toro Rosso’s Pierre Gasly almost smashed into his teammate Brendon Hartley in the first session when Hartley was driving slowly due to a puncture. Gasly had to go into a runoff area to avoid a collision, ruining his lap.

“This is unacceptable,” Gasly shouted over team radio, while Hartley apologized for getting in his teammate’s way, saying he felt “pretty stupid.”

The two drivers collided at the last race in China.

Romain Grosjean qualified last for Haas after sliding off the track and stalling, meaning he failed to set a time.