Michael Schumacher has announced that he will retire from Formula 1 at the end of the season.
Lewis Hamilton is to replace the seven-time world champion at Mercedes from next year.
Michael Schumacher, 43, was linked with a move to Sauber for 2013 but has decided to end an F1 career that began in 1991.
“Although I am still able to compete with the best drivers, at some point it is good to say goodbye,” he said.
“During the past month I was not sure if I still had the motivation and energy which is necessary to go on.
“It is not my style to go on if I’m not 100% with it. With today’s decision I feel released from those doubts.”
Michael Schumacher won 91 races in 19 seasons, helping to revive Ferrari’s fortunes after he joined them in 1996.
He won his first title with Benetton in 1994 and repeated the feat the following year.
Michael Schumacher claimed five straight titles between 2000 and 2004, before retiring for a first time in 2006.
After three years away from the sport he made a comeback with Mercedes in 2010.
However, since his return he has managed just one podium finish in three seasons, at Valencia earlier this year.
Speculation that Michael Schumacher could retire at the end of the season first surfaced at the start of September, when Formula 1 boss Bernie Ecclestone said he was “sorry that he’s leaving us not being a winner, because he is a winner”.
Mercedes motorsport boss Norbert Haug said: “I thank Michael. We have known each other a long time; we started together in Group C racing and he went on to be the most successful driver in Formula 1, winning more races and titles than any other driver.
“We were competitors against him [when Schumacher was at Ferrari with Mercedes supplying McLaren with engines] and we had always dreamed of working together and it came after Brawn Mercedes won the World Championship in 2009.
“We did not achieve what we wanted to but Michael has laid some strong foundations and I want to thank him from the bottom of my heart.”
It is unclear what Michael Schumacher will decide to do after retiring, but Mercedes team principal Ross Brawn has already suggested a position is available for him within the motorsport group.
“We would like him to stay involved with Mercedes,” Ross Brawn said last week.
“There is a lot of things he can contribute – perhaps on the racing car side but certainly on the road car side and I think that is something he would enjoy a great deal.
“I think with a few months reflection he will decide what he wants to do with the next part of his life, and I hope it is still with what we are doing here at Mercedes.”
Michael Schumacher’s career:
1969: Born 3 January
1991: Makes F1 debut in Belgium for Jordan team
1992: Third in championship for Benetton
1994: Wins first title for Benetton
1995: Second title
1996: Joins Ferrari
2000: First title for Ferrari
2001-04: Makes it five titles in a row
2006: Last win in China. Retires at end of the season
2010: Returns to F1 with Mercedes
2012: Announces retirement at end of the season
Michael Schumacher in numbers:
World championships: 7
Race wins: 91
Seasons in F1: 19
Points scored: 1,560
Points finishes: 220
Podiums: 155