The Duke of Edinburgh will be home for his 91st birthday on Sunday.
Prince Philip left London's King Edward VII hospital, where he was being treated for a bladder infection, on Saturday.
Smiling and waving to well-wishers, he shook hands with staff before getting into a waiting car.
"The Duke of Edinburgh continues to make a good recovery, " said a spokesman for Buckingham Palace. "He will continue his convalescence at home. He will spend the weekend privately," he added.
On Friday, Philip was visited by Princes William and Harry, the latest in a series of visits from his family.
The Duke was taken in from Windsor Castle on Monday as a precautionary measure when he began feeling ill.
It meant he missed the remaining Jubilee celebrations, leaving the Queen to attend the concert and thanksgiving service without him.
His illness was not linked to the Thames River Pageant, during which he stood for four hours in cold and rain with the monarch.
Watch: Prince William takes George to meet his sister
It's a little princess!