At a morning press conference at the Nou Camp, the Manchester City legend fought back tears as he revealed the news.
He said: "This conference is to communicate that I have decided to stop playing football. It’s a very difficult moment.
"The decision I have made, I have taken for my health, that's the main reason I have taken this decision - because of the problem I had a month and a half ago.
"I was in the good hands of the medical staff that have done their best. And they told me the best thing would be to stop playing. So 10 days ago I made this decision but I want to tell everyone I did everything possible to have some hope but there wasn’t very much (that could be done).
"I am very proud of the career I've had, I am very happy.
"I have always dreamt of playing football since I first touched a ball. My dream was to play in the Primera Division. I never thought I'd get to Europe so I want to show my gratitude to everyone, regardless of wherever I trained.
"Atletico took a bet on me - and the people from Manchester City, you all know I feel about you.
"I did everything as best I could there and I am very grateful because they looked after me very well.
"And then here at Barca, the team has been great to me, it’s been incredible.
"This is without doubt one of the best teams in the world but things happen.
"I am very grateful because they treat me really well, the fans too.
"And the Argentinian national team.
"I am grateful to everyone who has come here to see me in this moment, to my family, and the people that work with me.
"To my teammates - most recently, those at Barcelona, I think I always did my best to help them win but I want to also give my thanks to my teammates who helped me to grow.
"I will leave now with my head held high, happy.
"I don't know what awaits me in my next life but I know there’s a lot of people who love me and want the best for me.
"I am grateful to the press who are here - most of them have treated me well. But now worries, it’s their work. I’m grateful to everyone for being here, to all the clubs I have played at and I will always remember the amazing things. Thank you all."
From everyone connected to Manchester City, it has been a privilege, Sergio.
Revisit our Gracias, Sergio content from this summer to celebrate the career of one of this Club's greatest ever players.