British media reports have suggested the new deal could be worth up to 40 million pounds ($52 million) a year and is likely to make the four-time F1 champion the sport's top earner.
Four-times Formula One world champion Lewis Hamilton ended months of speculation about his future on Thursday by signing a new two-year deal keeping him at his Mercedes team until the end of 2020.
The 33-year-old Briton would have been out of contract at the end of this season and the negotiations have been a major talking point in the paddock.
No financial details were given in a Mercedes statement but British media reports have suggested the new deal could be worth up to 40 million pounds ($52 million) a year and is likely to make Hamilton the sport's top earner.
Thursday's announcement is now likely to trigger other driver decisions, with Australian Daniel Ricciardo set to remain with Red Bull but waiting for Mercedes to set out their plans.
Hamilton's current team mate Valtteri Bottas is also out of contract at the end of the year and there is no mention of the Finn in Thursday's statement.
"This contract extension has basically been a formality since (team chief) Toto (Wolff) 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," Hamilton said ahead of Sunday's German Grand Prix.
"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," he added.
"I'm very confident that Mercedes is the right place to be over the coming years."
While Hamilton had been expected to stay with the team that has won both the drivers' and constructors' titles for the past four years, there had still been some lingering doubts about his commitment to the sport.
Former team mate Nico Rosberg stunned the team in 2016 when he won the title and then announced his retirement only days later.
Hamilton, who won his first title with McLaren, enjoys a celebrity lifestyle with plenty of interests -- mainly in music and fashion -- outside of Formula One and there have been questions about how long he will race on for.
The Briton, winner of 65 Grands Prix and with a record 76 career pole positions from 218 races, said on Thursday that he is still hungry for success.
"The competitive passion that burns bright inside me is shared by every single member of this group -- always chasing the next improvement and digging even deeper to make sure we come out on top," he said.
"I can't wait to see what we can achieve together in the next two-and-a-half seasons."
The Briton is currently eight points adrift of Ferrari's Sebastian Vettel, also a four-times world champion, at the halfway point in the season. Vettel has won four races this year to his rival's three.
Wolff recognised there had been plenty of speculation in recent months and was happy to put it to bed.
"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."