Philip had a stent operation on his heart in 2011 but the Palace has not commented on what type of surgery he had this time.
Buckingham Palace previously said the Duke walked into King Edward VII's Hospital unaided and was only likely to spend a few days there as a "precautionary measure".
Instead, he received treatment for an infection before he was pictured leaving King Edward VII's clinic in an ambulance surrounded by police on Monday.
He has now spent 17 nights in hospital, his longest-ever stay.
Camilla Parker-Bowles yesterday said the prince was "slightly improving" but his treatment for an infection and pre-existing heart condition "hurts at moments".
"We keep our fingers crossed," added the Duchess of Cornwall, during a vaccination centre visit.
Last week, Prince Edward said he had spoken to his father on the phone and he was "looking forward to getting out".
"As far as I'm aware, well I did speak to them the other day, so he's a lot better thank you very much indeed, and he's looking forward to getting out, which is the most positive thing," Edward told Sky News. "So we keep our fingers crossed."
Prince William told reporters his grandfather was "okay, they're keeping an eye on him". Prince Harry reportedly rang the Queen to ask after the Duke of Edinburgh and was quarantining in California in preparation to fly back at a moment's notice should Philip's condition worsen.
But the current tensions between Harry and Meghan and the royal family make the entire situation more complicated. The Sussexes have ignored calls for them to postpone their bombshell CBS interview this Sunday (Tuesday in NZ).
Prince Charles visited his father the weekend before last, looking sombre as he left. His visit came despite reports the Queen and other royals would only be allowed inside during "exceptional circumstances" because of Covid-19 restrictions.