Ramires says his final months with Palmeiras were plagued by abuse on social media, though says he is grateful for the support he received from coach Abel Ferreira at the time.
He told Globo Esporte: "I was already in a state of anxiety and even going into depression. Then I retired, looked for a psychologist, started talking, exposing myself, and life got better.
"Abel is a guy who brought me peace for the decision I made to stop and end my career. And it gave me the opportunity to end my career in a dignified and 'naughty' way. Having finished my career was the best thing I did and I do not regret it, I say it from my heart."
Ramires also said: "I've always been very competitive. When I came to Palmeiras, I started having a series of injuries. In my head, I was starting to be a burden to the club for not playing, for pay. Football for me has never been just financial. I left Barra do Pirai, went to Joinville, won 80 reais and never changed clubs for money, but always for opportunities for greater visibility.
"Abel asked me if I wanted to get out the front door or the back door. It started to give me opportunities, more minutes of play and I started to regain competitiveness. I commented that my head was no longer turned to football, several things happened in my personal life. Still, I continued a little more and then the conversation was with family and close friends.
"Everyone said I still had firewood to burn, but there was no way. It did not surprise me for coming from Abel. He is an excellent coach, an extraordinary person to meet in football. He called me to join the technical team. But he saw how I was.
"Social media is overstepping the limit. You're working and you're getting threats. Against me, no problem, because I was always surrounded by security guards. My biggest concern has always been my family. My mother, my brothers, my children. They know the athlete's entire family and send their children's names on the social network threatening. That's when you stop and you're powerless, with nothing to do.
"You will play in Porto Alegre and suffer threat involving your child in Sao Paulo. I stopped and saw that it was not the path I wanted to take."