Britain's Prince Philip was discharged Thursday from a hospital after he was treated for an infection, Buckingham Palace said.

The Duke of Edinburgh was admitted to a London hospital Tuesday night as a "precautionary measure." The infection was caused by a pre-existing condition, the palace said in a statement.

Philip, who is Queen Elizabeth's II's husband, announced last month he will be stepping down from royal duties, like attending public events. He also missed the Queen's speech at the state opening of Parliament on Wednesday and the Royal Ascot horse races.

Philip, 96, left the hospital in "good spirits."

The royal has been hospitalized several times in recent years, including for treatment of a blocked coronary artery in 2011 and a bladder infection in 2012, but he has been in generally good health.