The Duke of Edinburgh joked he “can’t stand up much” after Buckingham Palace announced he will retire from public life later this year.
The Palace said it was Prince Philip’s decision taken with the support of the Queen.
In just a few weeks’ time, on 10 June, the Duke will turn 96.
The statement read: “Prince Philip will attend previously scheduled engagements between now and August, both individually and accompanying The Queen.
“Thereafter, The Duke will not be accepting new invitations for visits and engagements, although he may still choose to attend certain public events from time to time.
“The Duke of Edinburgh is Patron, President or a member of over 780 organisations, with which he will continue to be associated, although he will no longer play an active role by attending engagements.
“Her Majesty will continue to carry out a full programme of official engagements with the support of members of the Royal Family.”
At an engagement at St James’s Palace in central London with his wife on Thursday, a guest told the Duke he was sorry to hear he was standing down.
“I can’t stand up much,” quipped the prince, whose off-the-cuff remarks have sometimes landed him in hot water.
Prime Minister Theresa May said the whole country would want to offer the Duke “our deepest gratitude and good wishes”.
The Labour leader Jeremy Corbyn said his “clear sense of public duty” had inspired people for more than 60 years.
The announcement comes after royal staff from across the country were called to an emergency meeting Buckingham Palace.
International speculation followed, including a story mistakenly published by The Sun falsely reporting Prince Philip’s death.
When the Duke turned 90, he stepped down as president or patron of more than a dozen organisations – but has still been involved with more than 800 charities or bodies.
He is the longest-serving consort in British history – supporting the nation’s longest-reigning monarch.
His controversial comments, from describing Chinese people as “slitty-eyed” to asking a sea cadet whether she worked in a strip club, are legendary.
The Duke has never curbed his off the cuff remarks, and even at the age of 94 he was caught on camera swearing at an RAF photographer for taking too long to take a picture.
He set up the Duke of Edinburgh Award in 1956 and it has become one of the best known self development and adventure schemes for 14- to 24-year-olds.
Millions have signed up to work towards their Bronze, Silver and Gold awards and the scheme has been praised for challenging young people and broadening their horizons.
In a statement issued by Downing Street, Ms May said: “On behalf of the whole country, I want to offer our deepest gratitude and good wishes to His Royal Highness the Duke of Edinburgh following today’s announcement that he will stand down from public duties in the autumn.
“From his steadfast support for Her Majesty the Queen to his inspirational Duke of Edinburgh Awards and his patronage of hundreds of charities and good causes, his contribution to our United Kingdom, the Commonwealth and the wider world will be of huge benefit to us all for years to come.”
Mr Corbyn said: “I would like to pay tribute to Prince Philip following his decision to retire from public service.
“He has dedicated his life to supporting the Queen and our country with a clear sense of public duty.
“His Duke of Edinburgh’s Award scheme has inspired young people for more than 60 years in over 140 nations.
“We thank Prince Philip for his service to the country and wish him all the best in his well-earned retirement.”
The Liberal Democrat leader Tim Farron said: “Perhaps 30 years later than most people retire, the Duke of Edinburgh is announcing that that is what he is intending to do, and I think it is a moment to celebrate and take stock of the enormous achievements that he has made in his life so far, the enormous service he has given to his country, the service to countless charities he has supported, plus while being such a rock for Her Majesty the Queen.
“I think it is a moment for us to be genuinely reflective of a great life well-lived and great achievements.”
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies