The Duke of Edinburgh has been admitted to hospital for two weeks and will undergo an exploratory operation on his abdomen, Buckingham Palace has said.

Prince Philip’s admission to the London Clinic came shortly after he attended a Buckingham Palace garden party on Thursday afternoon.

Lord-Lieutenant of Nottinghamshire Sir John Peace, who attended the garden party, said the duke had been telling jokes at the event.

Philip, who turns 92 on 10 June, withdrew from an official engagement earlier this week after feeling “under the weather”. But he later attended a service to mark the 60th anniversary of the queen’s coronation.

In a statement on Thursday, Buckingham Palace said: “His Royal Highness the duke of Edinburgh has been admitted to the London Clinic for an exploratory operation following abdominal investigations. He is expected to stay in hospital for up to two weeks. Further updates will be issued when appropriate.”

A palace spokeswoman added: “He is in very good health.”

The operation will take place on Friday, following the investigations that were carried out over the past week.

The prince’s illness earlier this week is not thought to be connected to Thursday’s admission to hospital.

He was due to join the Queen at a gala reception for the Royal National Institute of Blind People at St James’s Palace on Monday but pulled out at the last minute because he was said to be unwell.

The palace spokeswoman said: “He felt unwell on Monday and missed an engagement but that was down to the fact he had temporarily lost his voice.”

The Queen will still perform her engagements as planned on Friday, which include a visit to the new BBC studios in central London.

The prince, who is longest-serving consort in British history, has been admitted to hospital several times in recent years. He did not attend the opening ceremony of the Paralympic Games last August as he was recovering from a bladder infection.

He was then treated for a recurrence of an illness that affected him in June the day after the Thames river pageant when he and the Queen spent four hours on their feet, some of it on the royal barge in the middle of the Thames, in cold and extremely wet conditions.

The illness meant the duke missed several key events of the Queen’s diamond jubilee weekend, including a service of thanksgiving at St Paul’s cathedral, a livery luncheon at Westminster Hall, and a balcony appearance by senior royals at Buckingham Palace.