LONDON — Britain's Prince Philip was admitted to a London hospital Friday for "observation and treatment," Buckingham Palace said in a statement.

The prince, who is Queen Elizabeth II's husband, was admitted as a precautionary measure in relation to a preexisting condition on the advice of his doctor, the palace added.

It was a planned visit and the 98-year-old walked in for treatment, a spokesperson for the palace told NBC News, adding the queen remains at her Sandringham Estate in Norfolk in eastern England.

The prince, who is is the longest-serving consort of any British monarch, is expected to remain in the King Edward VII hospital for a few days, the spokesperson added.

He retired from public life in 2017, after spending decades supporting the queen and attending events for his own charities and organizations.

On their golden wedding anniversary in 1997, the queen said he did not take easily to compliments but had been her "strength and stay all these years".

A former naval officer and keen polo player, Philip enjoyed robust health well into old age but has had a number of health issues in recent years.

In 2011, he was rushed to a hospital by helicopter from Sandringham after suffering chest pains and treated for a blocked coronary artery. In 2017, he spent two nights in the King Edward VII hospital and was hospitalized for 10 days in 2018 for a hip replacement.

Philip had a rocky start to the year when he was involved in a collision in a rural area of eastern England in January. The following month, Buckingham Palace announced that he had voluntarily surrendered his driver's licence.

The prince's last public appearance was in May when he attended the wedding of Lady Gabriella Windsor in St. George's Chapel at Windsor Castle alongside the queen.

His career has been punctuated by the occasional gaffe and off-color comment; in 2015, he made headlines when he exasperatedly swore at a photographer.

Elizabeth and Philip have four children — Prince Charles, born in 1948; Princess Anne, born in 1950; Prince Andrew, born in 1960; and Prince Edward, born in 1964.