LONDON (AP) — Prince Philip, the elderly husband of Queen Elizabeth II, has been hospitalized with an infection, but Buckingham Palace said Wednesday that he’s out of bed and in good spirits.

The palace didn’t paint a dire picture of his situation, but there are concerns for Philip because of his advanced age. He turned 96 earlier this month, and in May announced that he was stepping down from public life.

He seemed in fine shape Tuesday afternoon at the Royal Ascot horse races, wearing a formal suit and top hat despite sweltering heat at an outing with the queen and senior family members.

Later that night, however, a physician advised him to seek hospital treatment for an infection. The palace said the infection was related to an existing condition that wasn’t made public.

He traveled to King Edward VII Hospital in London by private car, not ambulance. Buckingham Palace said Philip was admitted as a precautionary measure.

The queen, 91, maintained her official schedule Wednesday, giving a speech outlining the government’s legislative plan in Parliament, and attending the Royal Ascot horse races in the afternoon as had long been planned.

She traditionally attends each session of the racing event, one of the highlights of the summer season.

Philip, also known as the Duke of Edinburgh, said in May he was cutting down his public appearances and wouldn’t take on new charity roles after more than six decades of service.

He has suffered a blocked coronary artery and a severe bladder infection in recent years but has been in generally good health.

When he announced he was stepping back from public life, he joked that it was getting harder for him to keep standing up. But he has never seemed tired in public, and always walks with nearly perfect military bearing.

Philip still attends summer garden parties with the queen, hosting more than 2,000 guests at a time, and has maintained his presence at important ceremonial events, including the Trooping the Color procession earlier this month.

The queen and Philip both had suffered from severe cases of the flu at Christmas.