Lucas was advised by doctors to put his career on hold back in December after the issue was first detected.
Lucas rejoined boyhood club Gremio last summer after five years with Lazio in Italy and scored three goals in 18 appearances as promotion was secured from Serie B to the Brazilian top flight.
Lucas, who won 24 caps for the Brazil national team, earned cult hero status at Liverpool during a ten-year stay at Anfield between 2007 and 2017.
In a tearful press conference on Friday, Lucas said: "Firstly I would like to thank Gremio for all the support in these three months."
"Today, I am announcing my retirement.
"It's been a difficult period, I think this is the first time I've cried over this case. But I can only thank you. I'm ending where I'd like, not the way I'd like. But I'm sure a new cycle will begin.
"I had a lot of hope that it could reverse, but it was not the case. My health comes first."
Gremio club president Alberto Guerra also spoke after the midfielder's announcement, as he added: 'I had prepared a beautiful speech, but I don't know if I'll be able to say it all.
'I wanted to congratulate you on a successful career. I'm very happy that you're going to go on with a normal life. I want to say on behalf of all the Gremistas that few have represented us like you.
'That's why so many people are moved by this moment. You are a great leader in the locker room that we all learned to respect.'