Queen Elizabeth II's 99-year-old husband Prince Philip has undergone a successful heart procedure, Buckingham Palace said Thursday after he was transferred to a cardiac unit in London.

Royal officials said the Duke of Edinburgh, as he is formally known, "underwent a successful procedure for a pre-existing heart condition at St Bartholomew's Hospital" on Wednesday.

"His Royal Highness will remain in hospital for treatment, rest and recuperation for a number of days," they added.

Philip has now spent more than two weeks in hospital, his longest every stay, raising fears for his health because of his advanced age.

He will turn 100 on June 10.

The prince was first admitted to the private King Edward VII Hospital in central London on February 16.

Buckingham Palace said initially that he was expected to stay there for a "few days" after walking in unaided.

Later, the palace said that he was being treated for an infection, without specifying further.

But on Monday, he was taken to the state-run St Bartholomew's Hospital near St Paul's Cathedral for testing and observation of a "pre-existing heart condition".

The hospital, known as Barts, dates back to the 12th century and has a renowned cardiac unit.

Philip had a stent fitted in 2011 after suffering a blocked coronary artery, undergoing treatment at the specialist Royal Papworth Hospital in Cambridge.

His daughter-in-law Camilla, Duchess of Cornwall, said Wednesday that Philip was "slightly improving," but "hurts at moments."

"We keep our fingers crossed," she added.

Camilla's husband -- Philip's eldest son and heir to the throne, Prince Charles -- visited him in hospital last month.

Philip's youngest son Prince Edward and grandson Prince William have both commented on his state of health.

Edward said his father -- a former naval officer -- was looking forward to being discharged.

William said he was in good hands and being closely monitored.

Queen Elizabeth II, who is 94, has herself continued her royal duties despite her husband's illness.

The couple have been married for more than 73 years.

Philip's illness comes as the royal family has come under fierce criticism from Prince Harry's wife Meghan Markle.

In a clip from an Oprah Winfrey interview to air Sunday, Meghan accused Buckingham Palace of "perpetuating falsehoods" about her and her husband.

This came after Buckingham Palace said it was looking into a report in The Times newspaper on allegations of bullying by Meghan against members of household staff.