Lewis Hamilton has committed his Formula 1 future to Mercedes, with the team announcing a new two-year contract with the Briton ahead of the German Grand Prix.

Following months of speculation about the world champion’s future, as Lewis Hamilton and his team fleshed out the details of a new deal, an announcement was made on Thursday.

Hamilton will be committed to Mercedes until the end of 2020.

Speaking about the contract, Hamilton said he never had any doubts that he would recommit to the team that has helped him land three world titles since 2014.

"This contract extension has basically been a formality since Toto and I sat down during the winter, so it's good to put pen to paper, announce it and then get on with business as usual,” he said.

"I have been part of the Mercedes racing family for 20 years and I have never been happier inside a team than I am right now."

More Lewis Hamilton car stories:

"We are on the same wavelength both on and off track - and I am looking forward to winning more in the future and shining even more light on the three-pointed star.

"I'm very confident that Mercedes is the right place to be over the coming years."

Mercedes boss Toto Wolff said that the final terms were only settled on this week, despite negotiations having been pretty well advanced last year.

"We have been aligned with Lewis ever since we first sat down to discuss the details of this contract after last season, but there has understandably been a lot of interest and speculation around the whole process, so it's good to put all of that to rest and get this thing announced,” he said.

"We signed the final documents this week and didn't want to keep people waiting any longer! There is not much about Lewis as a Formula One driver that hasn't been said already - he is one of the all-time greats and his track record speaks for itself.

"But what I enjoy most about working with him is getting to know the man inside the racing helmet: his relentless drive for self-improvement, his emotional intelligence as a team member and his loyalty to those around him."

Valtteri Bottas is expected to remain at Mercedes alongside Hamilton, but no announcement has been made on that front yet.

Gallery: Hamilton Signs New Two-Year Deal With Mercedes