"The Duke of Edinburgh has had an exploratory operation following abdominal investigations," Buckingham Palace said in a brief statement.
The Queen's husband, who will be 92 on Monday, was admitted to the London Clinic on Harley Street yesterday and is expected to stay in hospital for about two weeks.
The Palace officials said the results from the surgery would now be analysed.
According to the Palace, the Duke of Edinburgh was admitted to The London Clinic last night shortly after he attended a palace garden party yesterday afternoon.
More From This Section
A spokesperson at the clinic had described the Duke as being in good spirits.
Philip was said to be "comfortable" and the treatment went "as planned", the BBC reported.
Buckingham Palace said yesterday the hospital admission was pre-arranged and not an emergency.
In the past week, the duke has been having unannounced "abdominal investigations" at the hospital, where police officers have been standing guard outside.
British Prime Minister David Cameron's office sent a message to the prince on Twitter, saying, "The prime minister wishes the Duke of Edinburgh a swift recovery."
On Monday, he had pulled out of an engagement for the Royal National Institute of Blind People after becoming unwell ahead of last week's service marking 60 years since the Queen's coronation.
However, he was present at the service at Westminster Abbey on Tuesday.