The 80-year-old had an operation on September 4 and had been in intensive care. The Albert Einstein Hospital where he had been staying said on Thursday he was stable but would “continue with chemotherapy”.
Pele, who is the only player to win the World Cup three times and is Brazil's all-time leading scorer with 77 goals in 92 games, said he had been "punching the air more often than usual" after being discharged.
“I'm very happy to be back at my house,” he said.
"When the road is hard, celebrate every step of the journey. Focus on your happiness.
"It's true that I can't jump anymore, but these past few days, I've been punching the air more often than usual
"I want to thank all the staff at Albert Einstein Hospital, who made my stay pleasant.
“Thank you also to all of you who by far make my life complete with so many messages of love."