This extension means that Formula 1's superstar driver and reigning world champion would be around in the paddock for at least the next two years, till the end of the 2020 season.
"It's good to put pen to paper, announce it, and then get on with business as usual", Hamilton said.
"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".
Mercedes team principal Toto Wolff added: "We are very pleased to extend Valtteri's contract with Mercedes for another season at least - and to be able to confirm an unchanged driver line-up for 2019, ahead of our home race in Hockenheim".
Speaking to reporters and having dismissed suggestions that he might "do a Rosberg" and retire should he win a fifth title this year - the Briton long linked with a possible move to music or fashion - Hamilton was asked if he had been approached by any other teams as his talks with Mercedes dragged on.
"For me there's been no panicking to try and go anywhere, because once you're down four or five races of the year, it still feels like quite early in the season, but suddenly the time goes very quick, and you realise it's halfway, and it's better to get things sorted", said the Finn.
The Briton, victor of 65 grands prix and with a record 76 career pole positions from 218 races, said on Thursday that he was still hungry for success.
In Formula 1's drive to attract newer and younger audiences, Hamilton's rockstar image, legion of fans and social media obsession are important ingredients. "The competitive passion that burns bright inside me is shared by every single member of this group".
"I can't wait to see what we can achieve together in the next two-and-a-half seasons".
Lewis Hamilton has confirmed that he will race with Mercedes until the end of 2020, and it is likely that a clearer picture of what the 2019 grid will look like will appear during the summer break, which follows the Hungarian Grand Prix at the end of July.
The Brackley, England-based outfit now has its sights set on the German Grand Prix as it sits 20 points off of Ferrari's lead for the Constructors' with Hamilton eight points back on Sebastian Vettel for the Drivers' Title.
"Mercedes has become Lewis' home in Formula One and his story is linked forever with the silver and green of Mercedes-AMG Petronas". I think any battle is good.