Prince Philip, the husband of Britain's Queen Elizabeth, left hospital on the eve of his 91st birthday on Saturday, five days after he was taken ill during celebrations to mark the monarch's 60 years on the throne.
Looking relaxed and in good spirits, Philip, also known as the Duke of Edinburgh, smiled and shook hands with staff outside the central London hospital where he has been treated for a bladder infection since Monday.
His illness overshadowed the later stages of the Diamond Jubilee celebrations and meant the queen had to attend several events on her own, including a concert outside Buckingham Palace on Monday evening.
"His Royal Highness left hospital today. He continues to improve and he will now continue his convalescence at home," a palace spokesman said.
Wearing a tweed jacket, white shirt and red tie, Philip waved at well-wishers and the media outside the King Edward VII Hospital before being driven away in a black Land Rover.
He nodded when asked if he was feeling better and looking forward to his birthday. He will celebrate with his family on Sunday, the palace said.
Philip was taken to hospital after spending hours on a ceremonial barge in driving rain and a cold wind as part of a flotilla of 1,000 vessels on the River Thames to mark the queen's landmark.
Royal aides said Philip was treated with antibiotics and made good progress during the week.
His grandsons Princes William and Harry, sons of heir-to-the-throne Prince Charles and the late Princess Diana, visited him in hospital on Friday.
The Greek-born former sailor is known for his gaffes and off-the-cuff comments about groups such as the Chinese, deaf people and Australia's Aborigines.
But the longest serving consort in British history has also won admirers for his charity work and loyal support to the queen. She has described him as her "strength and stay" and once said she owes him "a debt greater than he would ever claim."
© 2015 Thomson/Reuters. All rights reserved.