LONDON — Queen Elizabeth II’s husband, Prince Philip, is being treated in hospital for an infection Wednesday, according to royal officials who said he was “in good spirits.”

The 96-year-old was admitted to King Edward VII Hospital in London late Tuesday as a precaution “for treatment of an infection arising from a pre-existing condition,” Buckingham Palace said in a statement.

It means the royal, whose official title is the Duke of Edinburgh, will miss the official state opening of parliament taking place later Wednesday.

“Prince Philip is in good spirits and is disappointed to be missing the State Opening of Parliament and Royal Ascot,” the statement said.

PHOTOS: Prince Philip Through the Years

The episode comes as the queen’s confidante and companion of more than 70 years prepares to step down from his royal duties.

However, the 91-year-old queen has no plans to scale back from her duties. She will be accompanied at the opening of parliament by her son and heir to the British throne, Prince Charles.

She was later due to attend the horse racing at Royal Ascot, Berkshire.

“Her Majesty is being kept informed” of her husband’s health “and will attend Royal Ascot as planned,” the statement said.