Prince Philip left the hospital where he has been recovering after heart surgery on Tuesday and returned to Windsor Castle to be reunited with the Queen.

The Duke of Edinburgh spent 28 nights as an in-patient – his longest ever stay – after he was admitted on 16 February.

He was initially taken to King Edward VII’s Hospital after feeling unwell at Windsor and was moved to St Bartholomew’s Hospital in the City of London two weeks later.

He underwent surgery for a pre-existing heart condition at St Bartholomew’s on 3 March, before being transferred back to King Edward’s to recover and continue treatment.

The duke left the private hospital in the back of a black BMW on Tuesday morning. Buckingham Palace later issued a statement confirming his release.

His Royal Highness wishes to thank all the medical staff who looked after him at both King Edward VII’s Hospital and St Bartholomew’s Hospital, and everyone who has sent their good wishes, the palace said.