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
The US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…