LONDON (AP) — Buckingham Palace says the Duke of Edinburgh — the husband of Queen Elizabeth II — has left the hospital after a hip replacement operation.

The palace says in a statement Friday that he will continue his recovery at Windsor Castle. He is expected to need a rehabilitation period and to use crutches for weeks. 

Prince Philip, 96, had surgery April 4 at the King Edward VII Hospital.

Philip had suffered from hip pain in recent weeks and had missed a number of family events, including an Easter church service with the queen and other members of the royal family.

The palace says "his royal highness would like to convey his appreciation for the messages of good wishes he has received."