The 33-year-old joined the Brussels club at the age of six, and his career has now come full circle after a trophy-laden stint at City.
He announced on his Facebook page: “I choose to be grateful for the past but remain ambitious and driven for the future.
“For the next three years, I will take up the role of player-manager of Anderlecht. Belgium’s finest.
“This may come as a surprise to you. It’s the most passionate yet rational decision I’ve ever made.”
Kompany revealed that he had met with Anderlecht chairman Marc Coucke and sporting director Michael Verschueren last summer.
“I shared my thoughts and listened to their vision for the future: ambitious, courageous and determined to get back to number one,” he wrote.
“I offered my help, no strings attached, should they need it.”
Kompany says he was then offered the player-manager job in the last few weeks.
“I want to share my knowledge with the next purple generations,” he continued.
“With that, I will also put a bit of Manchester in the heart of Belgium. This is no goodbye. It’s a see you later.”
The 33-year-old Belgian has decided to call time on his 11-year association with the club having won four Premier League titles, two FA Cups, four League Cups and two Community Shields.
In total, he has played 360 times, scoring 20 goals.
Commenting on his decision, Kompany told the club’s website: “As overwhelming as it is, the time has come for me to go. And what a season to bow out. I feel nothing but gratefulness. I am grateful to all those who supported me on a special journey, at a very special club.
“I remember the first day, as clear as I see the last. I remember the boundless kindness I received from the people of Manchester.
“I will never forget how all Man City supporters remained loyal to me in good times and especially bad times. Against the odds you have always backed me and inspired me to never give up.
“Sheikh Mansour changed my life and that of all the City fans around the world, for that I am forever grateful. A blue nation has arisen and challenged the established order of things, I find that awesome.”
Paying tribute to Kompany’s huge contribution to the club’s success, City chairman Khaldoon Al Mubarak said: “There have been many important contributors to Manchester City’s renaissance, but arguably none are more important than Vincent Kompany.
“He defines the essence of the club. For a decade he has been the lifeblood, the soul, and beating heart of a supremely talented squad.
“A booming voice in the dressing room yet a quiet and measured ambassador off it, Vincent can be as proud of himself as we are of him.
“His leadership, intelligence and determination have seen him adapt brilliantly to playing under four different managers and overcome some debilitating injuries. He is a special character who has answered every demand the club has made of him.
“We now look forward to celebrating his testimonial match in September so that we can properly celebrate his City contribution. He will always be part of the City family.”
Kevin De Bruyne hailed the legacy created at Manchester City by long-serving captain Vincent Kompany after the club completed an unprecedented domestic treble with a 6-0 thrashing of Watford in the FA Cup final.
The Hornets were swept aside at Wembley on Saturday and Belgian midfielder De Bruyne had high praise for his skipper, whose City future is unclear heading into the summer.
“Ah, he’s very important. You know to be at the club for 10, 11 years says enough, you know, and especially at the level that City is playing now,” De Bruyne said of his compatriot.
“To maintain that level says enough about Vinnie and whatever he does I support him and his decision. I don’t know what he’s going to do. I think he showed enough already to everybody in the world and I think it’s his time to make his decision.
“You know, I think everybody should wait until he decides and that’s it. If he goes it would be, yeah, a little bit bad for us. But then other people have to pick up (from) what he left.
“The legacy he left behind is great not only for City but in the Premier League, and I think everybody should appreciate what he’s done for English football.”