SPA-FRANCORCHAMPS, Belgium -- Ferrari has confirmed Sebastian Vettel will remain at the team until the end of 2020.

The deal brings an end to months of speculation about Vettel's future and rules out a switch to Mercedes in the near future. It follows news earlier this week that Kimi Raikkonen has signed another one-year deal to remain at Ferrari next season.

A short statement following the final practice session at the Belgian Grand Prix confirmed the news from Maranello, stating Vettel had extended his "technical and racing agreement" with the team.

The length of the deal means he will remain at Ferrari until he is 33 years old and takes him off the driver market next year when a number of top driver contracts are due to expire. There had been speculation that Vettel was angling for a one-year deal in order to keep Mercedes as an option for 2019, but the new Ferrari deal rules that out.

Immediately after the news was revealed, Mercedes confirmed it held talks with the four-time world champion earlier this year, but that Ferrari's resurgence this season made him unwilling to make a switch.

Mercedes non-executive Niki Lauda told Sky Sports: "We discussed it briefly once with him, but the more competitive Ferrari goes the less the reason he would want to leave. 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 news makes it incredibly likely that the top three teams -- Ferrari, Mercedes and Red Bull -- will retain the same driver line-ups for next year, with only Valtteri Bottas' future at Mercedes yet to be confirmed. Lewis Hamilton has another year on his contract, while Max Verstappen and Daniel Ricciardo are contracted for at least one more season a Red Bull.

Vettel joined Ferrari from Red Bull at the start of 2015 on a three-year deal and despite a win-less season in 2016, is now challenging for this year's title. He currently leads this year's championship by 14 points after scoring four wins in the first 11 races of the season.