The 81-year-old president, who has ruled Egypt for almost three decades, also had benign tissue removed during the operation conducted on March 6.
Mubarak handed presidential powers to Ahmed Nazif, the pime minister, just before the operation, and has not yet officially taken them back, although he has been shown speaking on the telephone with foreign leaders and local officials while at the hospital.
As with other occasions when he has had medical treatment, the latest incident sparked rumours about his health. It led to Egypt's stock market falling sharply in the days after the president's operation.
However, it steadied when images of him sitting and chatting with doctors were broadcast on March 16.