Pele "was discharged today. The patient left the hospital at 4:00 pm," the Albert Einstein hospital in Brazil's financial capital said in a statement.
An undated photograph provided by the hospital showed the former star forward of all-conquering Brazilian sides smiling, with his arm around his companion Marcia Aoki, and wearing street clothes.
The hospital earlier said that Pele had undergone surgery for nerve root decompression in his back on July 14 and that he was recovering satisfactorily. The operation was "preprogrammed."
The only player to have been in three World Cup-winning teams, Pele was reportedly due to undergo an operation on the problem last year but other health problems forced him to put off the surgery.
More From This Section
Known as "O Rei" ("The King"), Pele has been admitted to the same hospital several times going back to 2012.
In May, the global sporting icon was hospitalised for four days and had surgery for an enlarged prostate.
His one remaining kidney -- the other was removed following a rib injury during his playing days -- stopped working and had to be treated with dialysis.
He also had surgery on his femur in November 2012.
Pele was named Athlete of the Century by the International Olympic Committee in 1999.
The athlete, whose real name is Edson Arantes do Nascimento, is widely regarded as one of the greatest footballers to have played.