Valtteri Bottas will leave Mercedes and race for Ferrari-powered Alfa Romeo in a multi-year deal from 2022, the Swiss-based Formula One team said in a statement on Monday.
The Finn's departure clears the way for George Russell, 23, to leave Williams and join seven times world champion Lewis Hamilton at Mercedes.
"A new chapter in my racing career is opening," said Bottas, a nine-times grand prix winner, who will replace retiring compatriot and 2007 world champion Kimi Raikkonen.
"I am relishing the opportunity to help lead the team forward up the grid, especially with the new regulations in 2022 giving the team a chance to make a leap in performance.
"I'm grateful for the trust the team has put in me and I cannot wait to repay their faith: I'm as hungry as ever to race for results and, when the time comes, for wins."
Bottas, 32, joined Mercedes from Williams in 2017 after the abrupt retirement of 2016 world champion Nico Rosberg and he said he was proud of what he had achieved alongside Hamilton.
"It has been a privilege and a great sporting challenge to work with Lewis, and the harmony in our relationship played a big part in the constructors' championships we won as team mates," he said.
Mercedes have won the last seven drivers' and constructors' championships.
Alfa boss Frederic Vasseur, who worked with Bottas when the Finn was coming through the junior series, said the driver had shown he was a strong team player.
"Valtteri has been an integral part of a team that rewrote the history books and he has four constructors' world titles to his name: he is the right driver to help Alfa Romeo Racing make a step forward towards the front of the grid," he said.
"I'm really looking forward to seeing him put his ability to work for the good of the team."
Mercedes paid tribute to the Finn, without any mention of his replacement.
Hamilton took to social media to praise his soon-to-be former team-mate, describing him as the best he had driver alongside in Formula One.
"He has been the best team mate I've had the pleasure of working with," Hamilton said.
I'm immensely proud to have worked alongside @ValtteriBottas for the last 5 yrs. We’ve been part of a team that has delivered 4 Constructors’ Championships and we’ve motivated one another to keep pushing through the ups & downs. Thank you VB🙏🏾 let’s finish strong. pic.twitter.com/4YRJAhCzSN— Lewis Hamilton (@LewisHamilton) September 6, 2021
"Your speed and resilience has been impressive but where you truly stand out to me is the human being you are.
"You are greater than you know and I know there's a bright future ahead for you."
Hamilton's first team mate, at McLaren in 2007, was double world champion Fernando Alonso. They ended that season level on points with Hamilton ahead on placings and the Spaniard departing after a falling-out with the team.
Finland's Heikki Kovalainen, who only won once in his F1 career, joined him in 2008 and 2009 before then-reigning world champion Jenson Button arrived at McLaren in 2010.
Button finished ahead of his compatriot in the 2011 season.
Hamilton moved to Mercedes for the 2013 season to replace Michael Schumacher alongside Nico Rosberg, a boyhood friend and rival who beat him to the 2016 title as the relationship swiftly turned frosty.
"This hasn't been an easy process or a straightforward decision for us," Mercedes team boss Toto Wolff added of Bottas.
"Valtteri has done a fantastic job over the past five seasons and he has made an essential contribution to our success and to our growth.
"Together with Lewis, he has built a benchmark partnership between two team-mates in the sport, and that has been a valuable weapon in our championship battles and pushed us to achieve unprecedented success."
Wolff said Bottas, a calm and straightforward personality who gets on well with Hamilton, would have deserved to stay with Mercedes.
"When the time comes, he will leave us with huge goodwill from every single member of the team, and he will forever be part of the Mercedes family," said the Austrian.