The prince had been in the King Edward VII hospital for five nights, the BBC reported.
He smiled and waved to well-wishers and nodded when reporters asked if he was feeling better.
Prince Philip celebrates his 91st birthday Sunday and a spokesman for Buckingham Palace said he would spend the day in private.
The hospitalization came as Queen Elizabeth II, Philip's wife of almost 65 years, celebrated the 60th anniversary of her accession. Philip was at the queen's side for Sunday's Diamond Jubilee flotilla on the Thames but missed a concert Monday and church service and carriage procession Tuesday.