The Argentine striker suffered a heart scare in his debut against Alaves.
Aguero said, "This conference is to communicate that I have decided to stop playing football.
"It is a very hard time, but I am still very happy. The first thing is my health, you know why I made this decision. It's because of the problem I had a month ago. I was in the good hands of the doctors, who told me it was the best. I made the decision 10 days ago. I did my best to see if there was any hope, but there wasn't much.
"My dream was to play in the First Division and I never thought I would make it to Europe. I want to thank Independiente, Atlético de Madrid, Manchester City and Barcelona. Everyone has treated me very well. And, clearly, to the Argentine National Team, which is what I love."
Barca president Joan Laporta also said: "I'm by your side and you know it's as if the representatives of Independiente, Atlético de Madrid and City were here. I think we've been left with the desire at Barça, but we think you've made the right decision. You've been a player of world recognition and what you have sown, which has been a lot, you will surely pick it up in this new stage that is beginning. You deserve it and we wish you the best."