Britain's Prince Philip, the husband of Queen Elizabeth II, left hospital on Saturday after five days of treatment for a bladder infection that sparked concerns for the 90-year-old's health.
The prince shook hands with staff, smiled and nodded when asked if he was feeling better as he walked out of King Edward VII Hospitalin central London just in time to celebrate his 91st birthday on Sunday.
Britain's longest-serving consort was taken to the hospital on Monday with a bladder infection in the midst of huge celebrations for the queen's diamond jubilee, less than six months after treatment for a blocked coronary artery.
Wearing a sports jacket and beige trousers and a pink patterned tie, he walked slowly but without help from the hospital on Saturday to be whisked away in a Land Rover with police escort, seemingly in good spirits.
But it was unclear whether he would be able to carry out a hectic schedule of royal engagements in the coming week, and he appeared fragile as he entered the vehicle, grimacing before recovering to smile and wave at well-wishers.
Using the prince's formal title, a spokesman for Buckingham Palace said: "The Duke of Edinburgh was released from hospital this morning.
"He continues to make a good recovery and will continue his convalescence at home, and will be spending it privately."
He was to travel to Windsor Castle just outside London, the BBC reported.
The palace said earlier in the week that the prince was being treated with antibiotics.
His illness forced him to miss the final two days of celebrations for 86-year-old Queen Elizabeth's 60 years on the throne, including a spectacular pop concert outside Buckingham Palace on Monday.
Crowds at the concert cheered and shouted "Philip! Philip!" after heir to the throne Prince Charlessuggested, "If we shout loud enough, he might just hear us in hospital."
He also missed an appearance on the balcony of Buckingham Palace on Monday, at which more crowds of revellers cheered the queen and fellow royals.
But Prince Philip had been at the Queen's side for a huge jubilee river pageant last Sunday, travelling with her on a sumptuous red and gold royal barge down the Thames in London accompanied by a flotilla of 1,000 boats.
Doctors told British media the hours of wind, rain and chilly temperatures might have worsened his infection, but the prince had appeared well during the pageant, laughing and pointing out sights to younger royals.
The couple's granddaughter Princess Eugenie, 22, told Britain's Sky news in an interview broadcast Saturday, "They are the most incredibly supportive couple to each other."
On the jubilee, she added: "Grandpa was unfortunately taken ill and for Granny to come and do that alone was probably quite testing.
"And I think he is her rock, really, and she is his."
Philip suffered chest pains in the Christmas break and underwent a medical procedure for his blocked coronary artery. His health has generally been good but he said before his 90th birthday he would scale down his engagements.
It was not yet known whether he would be able to keep to his busy schedule of events next week, the spokesman said.
Philip is due to give a garden party with the queen at Sandringham House in Norfolk, eastern England, on Tuesday and both are scheduled to attend a jubilee picnic in neighbouring Lincolnshire on Wednesday.
More events follow in the week for the royal couple and Philip is also to chair a conference for senior regimental colonels and hold a dinner at Buckingham Palace on Friday.
Prince Philip has been a constant by his wife's side throughout her 60 years as queen, having given up a promising naval career to be a full-time consort when she acceded to the throne in 1952.
He shares her sense of duty and tradition but not always her diplomatic skills. He is known for his off-the-cuff japes that have famously strayed into the politically incorrect.
Prince Philippos of Greece and Denmark was born on a kitchen table on Corfu on June 10, 1921, the only son of prince Andrew of Greece and princess Alice of Battenberg.
He was formally introduced to princess Elizabeth in 1939, but it was not until July 1947 that their engagement was announced.
They married on November 20 at Westminster Abbey, with Philip giving up his Greek and Danish titles.
Besides their four children, Charles, Anne, Andrew and Edward, the royal couple have eight grandchildren and two great-grandchildren.