The Duke of Edinburgh has left hospital four nights after having a coronary stent fitted.
The prince, who smiled and waved to reporters as he left, has now returned to the Royal Family's Sandringham estate in Norfolk.
The 90-year-old had been in Papworth Hospital since Friday after being admitted following chest pains.
Prince Philip missed the royal Christmas celebrations and had to sit out the traditional Boxing Day shoot.
He sat upright and smiled broadly as he left the hospital.
In a statement, Buckingham Palace said: "On departure, Prince Philip thanked the staff at Papworth for the excellent care he has received during his stay.
"He is very much looking forward to rejoining his family."
Buckingham Palace also said no decision had been taken on how soon the Duke would resume public engagements or whether he would attend Sunday's service at St Mary Magdalene church on the Sandringham estate.
The prince is said to have been advised by doctors to rest.
BBC royal correspondent Nicholas Witchell said the prince had participated in more than 300 engagements in the last 12 months.
The Duke's next formal engagement is not until 17 January when he is due to attend a dinner at the Scott Polar Research Institute at the University of Cambridge.
He was unable to attend the Christmas Day service at the church or lead the Royal Family's shooting party on Boxing Day, as would usually be the case.
This year the prince was under doctor's orders not to leave his bed while he was kept under observation.
On his arrival at Papworth doctors discovered a blocked artery and went ahead with a "minimally invasive procedure of coronary stenting", which was declared a success.
Stenting involves inserting a tube called a stent into an artery, to improve blood flow.
It was the most serious health scare suffered by the normally spry nonagenarian.
He usually accompanies the 85-year-old monarch and in the autumn he travelled to Australia on a 11-day official visit to Perth, Melbourne, Canberra and Brisbane.
Scores of police officers combed the grounds of the hospital in the early hours of this morning in preparation for the Duke's departure.