Lewis Hamilton will join Mercedes from next season on a three-year contract.
The decision to leave McLaren after a 14-year association with the team has been described by one source close to Hamilton as "the toughest of his career".
The 27-year-old replaces Michael Schumacher at Mercedes, with the 43-year-old seven-times champion now likely to retire from Formula One for a second time.
Hamilton said: "It is now time for me to take on a fresh challenge and I am very excited to begin a new chapter racing for the Mercedes Formula One Team. Mercedes-Benz has such an incredible heritage in motorsport, along with a passion for winning, which I share.
"Together, we can grow and rise to this new challenge. I believe that I can help steer the Silver Arrows to the top and achieve our joint ambitions of winning the world championships."
McLaren announced earlier on Friday morning that Sergio Perez would be their replacement for Hamilton, the 22-year-old Mexican signing a multi-year contract with the Woking-based marque.
But it is Hamilton's switch which will send shockwaves through F1 as he now teams up with close friend Nico Rosberg at Mercedes.
Mercedes team principal Ross Brawn said: "I am delighted to welcome Lewis Hamilton to our team. The arrival of a driver of Lewis's calibre is a testament to the standing of Mercedes-Benz in Formula One and I am proud Lewis shares our vision and ambition for the success of the Silver Arrows.
"I believe the combination of Lewis and Nico will be the most dynamic and exciting pairing on the grid next year, and I am looking forward to what we can achieve together."
As for Schumacher, his future is unclear, but he said: "I have had three nice years with the team which unfortunately did not go as well as we all would have wanted on the sporting side. I wish Lewis well and for the team to achieve the success we worked so hard for in the build-up."