The Duke of Edinburgh smiled and waved as he left Papworth Hospital on Tuesday after his heart scare.
The 90-year-old royal was sitting in the front passenger seat of a dark Range Rover as he was driven away, five days after he was admitted.
"He will be rejoining the Queen and other members of the royal family at Sandringham," said a Buckingham Palace spokeswoman.
The Duke was taken to Papworth near Cambridge on Friday night after he complained of chest pains.
Buckingham Palace said Prince Philip had thanked staff at Papworth for his "excellent care" and added the Duke was "very much looking forward to rejoining his family".
Following tests, doctors discovered a blocked artery and he underwent a "minimally invasive procedure of coronary stenting", which was declared a success.
It was the most serious health scare suffered by the Duke, who is known for being robust and active.
He had hoped to be discharged from hospital in time for yesterday's Boxing Day shoot at Sandringham, which he normally leads, but remained under observation in hospital.
Despite the setback, he was said to be in good spirits.
He has shunned the pursuits of typical pensioners and even as an octogenarian continued to compete in demanding carriage driving competitions.
Philip's most recent illness was an uncharacteristic cold in October that forced him to pull out of an overnight stay in Italy for the launch of the ARC Green Pilgrimage Network.
At the time. he had just completed a busy 11-day official royal tour to Australia with the Queen, 85, that saw them visit Perth, Melbourne, Canberra and Brisbane.
His next formal engagement is a dinner at the Scott Polar Research Institute at the University of Cambridge on 17 January.
The Duke was visited in hospital by his grandchildren the Duke of Cambridge and Prince Harry on Christmas Day.
The brothers drove separate cars to Papworth after enjoying lunch at Sandringham, the Queen's private Norfolk estate, taking the Duke of York's daughters Beatrice and Eugenie and the Princess Royal's children Zara and Peter with them for a 45-minute visit.
Their visit would have been a welcome distraction for the Duke who is thought to have missed his first Christmas morning service at Sandringham, an annual tradition for the Royal Family since the early 1990s.
Suggested For You
SUBSCRIBE AND FOLLOW
Get top stories and blog posts emailed to me each day. Newsletters may offer personalized content or advertisements.Learn more