The 74-year-old football great was in a "stable" condition after the surgery this week, the Albert Einstein Hospital said in a statement on Thursday.
He underwent a procedure called transurethral resection of the prostate, which is usually needed to relieve urinary symptoms associated with an enlarged prostate.
The hospital did not release many details, but Brazilian media said the surgery was on Tuesday after Pele complained of urinary problems. The surgery was conducted reportedly to help prevent a urinary tract infection similar to the one that hospitalized him for two weeks almost five months ago.
At the time, Pele spent days in an intensive care unit while undergoing hemodialysis to help support his only kidney. The other was removed when he was still a player. Pele had to be closely monitored because of how his body reacted to the infection, but doctors said his life was never in danger. The infection stemmed from a surgery to remove kidney stones in November.
Widely regarded as the greatest footballer of all time, Pele is a national hero in Brazil and remains a worldwide ambassador to the game. He is also active with his many businesses, and still participates in many advertising campaigns.