SOCHI, Russia — Sebastian Vettel stormed to pole position for the Russian Grand Prix on Saturday, ending a run of 18 poles for Mercedes.

Vettel, the Formula One leader, shaved 0.059 seconds off his Ferrari teammate Kimi Raikkonen's leading time with his last attempt of the session. Mercedes' Valtteri Bottas and Lewis Hamilton were third and fourth.

For Vettel and Ferrari, their first pole since September 2015 helped to underline how the near-total Mercedes dominance of recent seasons has been broken. Ferrari hasn't had both cars on the front row since the 2008 French GP.

"If you have the rhythm here, it feels fantastic," Vettel said. "For now we're full of joy. We're very happy that we're back."

The German will be looking to claim his third win of the season on Sunday and extend his seven-point standings lead over Hamilton.

"I knew we were strong, I knew we can do it, but I didn't know how strong in relation to them," Vettel said.

Second-placed Raikkonen said he was "happier than the previous qualifyings," despite missing out by a whisker on what would have been his first pole for nine years.

While Bottas was within one-tenth of a second of Vettel, Hamilton was almost six-tenths off the pace, and pessimistic about his chances of passing the Ferraris in Sunday's race.

"It's very hard to overtake as it is. Their race pace yesterday (in practice) was better, at least, than mine," he said. "I'm just hopeful it's a race between the four of us."

In a sign of how far ahead the top two teams are compared to the rest, Hamilton was more than a second faster than fifth-placed Daniel Ricciardo's Red Bull.

The Sochi track has previously suited Mercedes, which had been looking to strike back at Ferrari after Vettel won the last race in Bahrain.

"Going into this weekend, we were thinking it's probably going to be better than Bahrain," Bottas said. "For sure, definitely it's disappointing for us not to be on pole."

Still, Bottas suggested he and Hamilton could ambush the Ferraris at the start on Sunday, helped by the long pit straight into a 90-degree right-hander.

"Second-row start here is not that bad a thing. It's a pretty long run," he said. Conditions for the race are set to be warm and dry, just as in qualifying.

Vettel's pole sets the stage for a much more competitive Russian race than any of the previous editions, which were all contests within the dominant Mercedes team.

The driver on pole has won two of the three Russian F1 races so far, the exception being in 2015 when Nico Rosberg retired with a throttle problem, handing victory to Hamilton.

Jolyon Palmer endured a miserable day, qualifying 16th after he lost control on a curb and crashed into the barrier. That was scant reward for his Renault mechanics, who earlier rushed to change the engine on Palmer's car when the previous power unit failed in the third practice.

Palmer said he was forced to take risks because of missing the earlier practice. "When you haven't done any laps today, it becomes a little bit more on the limit," he said. "Me losing the track time certainly contributed, but it's my mistake."