Prince Philip, who is set to celebrate his 100th birthday in June, was helped into a black BMW at the rear of the private King Edward VII hospital in Marylebone at about 10.30am before being driven away.
The duke spent 28 days as an in-patient, making this his longest stay in hospital.
Here is the timeline of the Duke of Edinburgh’s month-long hospitalisation:
The duke is admitted to King Edward VII’s Hospital on a precautionary basis after feeling unwell.
He travels from Windsor Castle by car and is said to be in “good spirits” and walks into the private hospital unaided.
He is expected to stay for a few days.
Buckingham Palace issue a statement on the duke’s hospitlisation. They said: “His Royal Highness the Duke of Edinburgh was admitted to King Edward VII’s Hospital in London on Tuesday evening.
“The duke’s admission is a precautionary measure, on the advice of His Royal Highness’s doctor, after feeling unwell.
“The duke is expected to remain in hospital for a few days of observation and rest.”
Sources say Philip is now expected to remain in hospital for “observation and rest” over the weekend and into the next week.
The Prince of Wales makes a 200-mile round trip to see his father, spending around half-an-hour at the hospital.
Seven days after the duke was admitted, the Palace says he is being treated for an infection and is “comfortable and responding to treatment”, but is not expected to leave hospital for several more days.
The Earl of Wessex says the duke is a “lot better” and looking forward to getting out.
Philip is transferred in an ambulance to St Bartholomew’s Hospital for treatment for an infection and testing and observation for a pre-existing heart condition, Buckingham Palace says.
The duke is shielded from public view by large umbrellas as he leaves King Edward VII’s Hospital.
The Queen continues with her official duties by holding calls with the Chancellor and the head of the British Army.
Philip undergoes surgery on his heart.
The Duchess of Cornwall says of her father-in-law: “We heard today that he’s slightly improving. So, that’s very good news. We’ll keep our fingers crossed.”
Buckingham Palace announces Philip had a “successful procedure” for a pre-existing heart condition at St Bartholomew’s Hospital the previous day.
The Palace adds: “His Royal Highness will remain in hospital for treatment, rest and recuperation for a number of days.”
Philip is moved back to the royal family’s favoured private King Edward VII’s Hospital.
The Palace says: “The Duke is expected to remain in hospital for continuing treatment for a number of days.”
After spending 28 nights in hospital, the duke is discharged from King Edward VII’s Hospital and returns to Windsor Castle.
Buckingham Palace says he “wishes to thank” medical staff who looked after him at both hospitals, and “everyone who has sent their good wishes”.