The legendary ex-Man City striker, who scored one of the most iconic goals in Premier League history, was in tears as he spoke in a press conference at the Nou Camp on Wednesday.
Aguero suffered chest pains in his first competitive start for the Spanish club against Alaves in October and was substituted before half-time.
He was immediately taken to hospital for cardiological tests, before Barca confirmed the striker would initially be out for three months.
However, the 33-year-old has now followed the advice from doctors and called time on his illustrious career.
He said in a press conference at the Nou Camp: "This conference is to announce I have decided to stop playing professional football. It is a very difficult moment.
"The decision I have taken for my health; the problem I had a month and a half ago.
"I have been in good hands with the medical staff. I made the decision 10 days ago after doing everything possible to have some hope of playing on. I am very proud for my career.
"I always dreamed of a professional career since the first time I touched a ball at five.
"I want to thank Atletico Madrid who took a chance on me when I was 18 and Manchester City, everyone knows who I feel about City and how well they treated me there."
He added: "I will leave with my head held high. I don't know what awaits me in the next part of my life. But I know I have people who love me. I will always remember the amazing things."
City boss Pep Guardiola and sporting director Txiki Begiristain, who both worked with Aguero during his time at the Etihad Stadium, were in attendance at the Nou Camp.
The Argentine won City their first Premier League title with his last-minute goal against QPR in 2012, helping them to further four during his time at the club.
He then moved to Barcelona in the summer, after ten years in Manchester, but only played five times for the LaLiga side.
He did, however, score for the club in an El Clasico against Real Madrid - the final goal of his career.
Aguero said, when asked what the favourite moments of his career were: "Winning the Europa League with Atletico was a really happy moment and then, obviously, with City, the goal I scored to win the first Premier League.
"For me and City, that was a beautiful moment.
"There are a lot and the last was the Copa America. I only played two or three matches, but it was something that we had been looking for for years and years.
"And of course, I will take my last goal against Madrid. It is not bad for a last goal is it!?"