File picture: Zsolt Czegledi/ MTI via AP.

World championship leader Sebastian Vettel will stay with Ferrari until 2020 after agreeing a three-year contract extension, the Italian team announced on Saturday.

In a statement that ended weeks of speculation over the future of the four-time champion German, Ferrari said it had "extended its technical and racing agreement with driver Sebastian Vettel for the 2018, 2019 and 2020 racing seasons."

It had been widely rumoured that the 30-year-old German was flirting with the possibility of joining Mercedes, a prospect dismissed on Friday by his title rival Lewis Hamilton.

The announcement came as little surprise to paddock observers, even if the timing was unexpected. Ferrari usually make their driver announcements at their home Italian Grand Prix at Monza, scheduled for next weekend.

The three-year extension ties in with Ferrari's own contract with Formula One that runs until 2020 when the team will seek to negotiate new terms for its participation with the sport's new US owners Liberty Media.

Vettel's original contract with Ferrari was scheduled to run to the end of this season, a situation that allowed him to use possible talks with other teams as leverage in his negotiations to stay.

However, given the team's resurgent form this year -– he was second behind team-mate Finn Kimi Raikkonen, who has re-signed for 2018, in the third free practice on Saturday morning -– there has been little doubt that he would remain with the Italians.

Mercedes admits approach

Mercedes non-executive chairman Niki Lauda revealed on Saturday that discussions had taken place with Vettel, but they did not go far.

"We discussed it briefly once with him, but the more competitive Ferrari goes, the less the reason he would want to leave," Lauda told Sky Sports F1. "So therefore we stopped right away a couple of months ago.

"I think every driver, if he's clever, talks to more than one team. Then when you negotiate you're in a better position. That's what he did."

The duration of his new contract will keep Vettel out of the driver market beyond d 2019 when a hectic spell of activity is expected in the sport with Dutchman Max Verstappen, still only 19, likely to become available unless his current Red Bull team become serious title contenders.

Raikkonen's extension for just one year signals also that Ferrari may swoop for Verstappen or any other rising star to partner Vettel in 2019.

Following Ferrari's announcement, it is now expected that Mercedes will extend Finn Valtteri Bottas's contract. He was signed on a one-year deal for this year as a replacement for retired 2016 champion Nico Rosberg.

Both Red Bull drivers Verstappen and Australian Daniel Ricciardo are under contract until the end of next year, as is Hamilton with Mercedes.