He was hospitalized more than a week ago after suffering from an unspecified illness.
The prince "has expressed his thanks to staff at the London Clinic, and to the many members of the public who have sent their good wishes," Buckingham Palace representatives said on Twitter Monday.
"His Royal Highness is expected to take a period of convalescence of approximately two months."
Philip announced when he turned 90 he was cutting back on his public duties although he continues to make many appearances with his wife and on his own. The queen, 87, maintains a heavy schedule but has handed off some responsibilities to her children.
Duggar sisters unveil Christian dating rules in new book
Astronomers offer more expansive view of universe