'I have always said that as long as Lewis still possesses the fire for racing, he can continue as long as he wants.'
Seven-time world champion Lewis Hamilton will be staying in Formula One for the next two years at least after he and Mercedes announced a contract extension on Saturday.
The new deal covers 2022 and 2023.
"I'm excited we're going to continue our partnership for two more years. We've accomplished so much together but we still have a lot to achieve, both on and off the track," said the Briton, 36, at the Austrian Grand Prix.
Hamilton, who joined Mercedes from McLaren in 2013 as replacement for retired seven-time champion Michael Schumacher, was out of contract at the end of this season after agreeing a one-year deal only in February.
"I have always said that as long as Lewis still possesses the fire for racing, he can continue as long as he wants," commented team boss and shareholder Toto Wolff.
Hamilton is the sport's most successful driver of all time, with 98 wins and 100 pole positions, and Mercedes had said they did not want to leave it so late again.
"I’m incredibly proud and grateful of how Mercedes has supported me in my drive to improve diversity and equality in our sport," said Hamilton, the sport's only Black driver, who has used his platform to campaign for social justice.
"They have held themselves accountable and made important strides in creating a more diverse team and inclusive environment.
"We’re entering a new era of car which will be challenging and exciting, and I can’t wait to see what else we can achieve together."
Hamilton is fighting for a record eighth title but is second in the current championship, 18 points behind Red Bull's Max Verstappen after eight races.
Wolff said there was "no better driver" to have in the team as they prepare for major rule changes in 2022.
"His achievements in this sport speak for themselves, and with his experience, speed and race-craft, he is at the peak of his powers," added the Austrian.
"We are relishing the battle we have on our hands this year and that’s why we also wanted to agree this contract early, so we have no distractions from the competition on track."
Liberty Media-owned Formula One welcomed the announcement that its star property had ended any speculation about his future.
"This is fantastic news for Formula One and I am delighted that Lewis will stay in F1 for at least another two years," said chief executive Stefano Domenicali.
"What he has achieved in this sport is incredible and I know he has more to come. He is a global superstar on and off the race track and his positive impact on Formula One is huge."
Hamilton's team mate for 2022 remains to be decided, with Finland's Valtteri Bottas out of contract and young Briton George Russell tipped to replace him.