Mercedes team principal Toto Wolff believes confirming Lewis Hamilton's future at Mercedes will allow the team to focus their efforts on the title battle against Red Bull.
"As we enter a new era of F1 from 2022 onwards, there can be no better driver to have in our team than Lewis," said Wolff in a statement.
"His achievements in this sport speak for themselves, and with his experience, speed and race-craft, he is at the peak of his powers.
"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.
"I have always said that as long as Lewis still possesses the fire for racing, he can continue as long as he wants."
F1 CEO Stefano Domenicali was very happy with the announcement because of the impact Hamilton has had on F1 and will continue to have for the next two seasons.
"This is fantastic news for Formula 1 and I am delighted that Lewis will stay In F1 for at least another two years," said 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 1 is huge."