The prince was being treated at King Edward VII Hospital in London.
Prince Philip, the 98-year-old husband of Queen Elizabeth II, is heading home from a London hospital just in time for Christmas, according to Buckingham Palace.
“The Duke of Edinburgh has today left hospital after being discharged by his Doctor and is now back at Sandringham,” the palace said in a statement Tuesday. “His Royal Highness would like to thank everyone who sent their good wishes.”
The royal family is spending Christmas at Sandringham, Queen Elizabeth’s estate in Norfolk, England.
Queen Elizabeth, 93, traveled to Sandringham from London on Dec. 20, the same day Prince Philip was taken from Sandringham to King Edward VII Hospital in London.
The Duke of Edinburgh was taken to the hospital for “observation and treatment in relation to a pre-existing condition,” the palace said in a statement at the time.
“The admission is a precautionary measure, on the advice of His Royal Highness’ Doctor,” the statement read.
Prince Philip, who wed then-Princess Elizabeth in 1947, retired from official royal duties in 2017.
He had at that time completed 22,220 solo engagements since 1952, given 5,496 speeches in his travels to more than 76 countries, authored 14 books, served as patron to 785 organizations and made 637 solo overseas visits, according to Buckingham Palace.
One year after his retirement, in 2018, Philip underwent hip replacement surgery at the age of 96.
The Duke of Edinburgh was involved in a car accident at the start of this year. In January, Philip was driving a Land Rover that was involved in a collision with a Kia near Sandringham Estate.
Philip was uninjured in the accident, Buckingham Palace said at the time.
The prince is featured in a selection of photos positioned next to Queen Elizabeth for her annual Christmas Day message.
The prerecorded message, which airs on BBC One on Wednesday, was filmed in the Green Drawing Room at Windsor Castle.
Members of the royal family will gather at Sandringham to watch the queen’s Christmas message together.