Image copyright AFP Image caption The Duke of Edinburgh was seen alongside the Queen at Trooping the Colour on Saturday

The Duke of Edinburgh was admitted to hospital on Tuesday as "a precautionary measure", Buckingham Palace has said.

He is being treated at the King Edward VII Hospital, London, for an infection arising from a pre-existing condition.

The BBC understands his hospital stay is "not a cause for serious concern" and the palace said the duke was "up and about and in good spirits".

The duke, 96, said in May that he would retire from royal duties this autumn - a move supported by the Queen.

She is still carrying out her official engagements and on Wednesday delivered the Queen's Speech to Parliament before heading to the racing at Ascot.

In a statement, Buckingham Palace said the Prince of Wales would accompany the Queen to Parliament and Prince Philip was "disappointed" to miss the event.

Prince Charles was asked about the duke while on a visit to the scene of the Finsbury Park mosque attack.

"He's getting better. He's getting better," he told reporters.

Image copyright Getty Images Image caption Prince Philip was at the races with the Queen on Tuesday

The duke was at the Queen's side on Tuesday afternoon for the opening day of the four-day Ascot race meeting.

It is understood he was not admitted to hospital as an emergency but, on a doctor's advice, was driven from Windsor Castle to the central London hospital on Tuesday evening.

How long he will remain there is not yet known.

By Peter Hunt, royal correspondent

The palace statement about Prince Philip's health has been designed to reassure.

This is a 96-year-old who is reported to be in "good spirits" and who is in hospital as a "precautionary measure".

He was driven there in a car, not an ambulance, from Windsor, where he was said to have been on great form when he attended the first day of the Ascot races. In sweltering heat yesterday, he was dressed in a morning suit.

The prince, like his wife and countless other people, isn't overly keen on publicising the precise nature of what ails him.

Given that he is being treated for a pre-existing condition, it is safe to assume that he is suffering from a reoccurrence of a bladder infection that laid him low on two occasions in 2012.

He is not bedridden, according to officials, but up and about inside the private hospital.

Philip's current good mood may be tested if, as was the case five years ago, he remains an in-patient for several days.

Read more from Peter here:

Prince Philip has spent much of his life in good health, but he was treated for a blocked coronary artery in 2011 and a bladder infection in 2012. That saw him miss much of the Queen's Diamond Jubilee celebrations.

He backs healthy eating and exercise. He drinks moderately, takes the stairs and says he still fits into the uniform he wore on the day he married the Queen, almost 70 years ago.