The Duke of Edinburgh will no longer carry out public engagements from September, the palace said in a statement.
"In taking this decision, the Duke has the full support of the Queen," it said, ending frenzied speculation in the media after the Queen had called an emergency meeting of all of her staff at the palace today.
The palace said that the royal, who turns 96 in June, will continue to attend previously scheduled engagements between now and August, with the monarch and individually. But he will not be accepting any new invitations for visits and engagements, although he may "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," the statement said, adding that the decision does not affect the 91-year-old monarch's public engagement calendar.
More From This Section
The royal, known for his sense of humour and off-the-cuff remarks, had indicated plans of "winding down" from public engagements on his 90th birthday.
In a message from Downing Street, British Prime Minister Theresa May said she wanted to offer the country's "deepest gratitude and good wishes" to the Duke of Edinburgh following today's announcement.
She said: "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."
He said: "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."
The announcement of the royal retirement followed an emergency meeting of her royal staff at Buckingham Palace earlier today.
The Lord Chamberlain, the most senior officer of the Royal Household and in charge of ceremonial events, and Sir Christopher Geidt, the Queen's Private Secretary, addressed staff from the Queen's royal residences across the United Kingdom.
The staff meeting came a day after the Queen met Prime Minister Theresa May at Buckingham Palace to formally agree the dissolution of Parliament, officially kick-starting the campaign ahead of the general election on June 8.
Their audience lasted over 30 minutes, much longer than the brief meeting that was anticipated.
Later today, the Queen and Prince Philip are due at a service for members of the Order of Merit at the Chapel Royal at St James' Palace near Buckingham Palace, before hosting a lunch for those attending.
Their son and heir, Prince Charles, and grandsons Princes William and Harry are likely to take on additional royal duties to step in for Prince Philip at public engagements from later this year.
The royal couple, both in their 90s, had already cut down on long-haul travel for some years now, with younger royals taking on those duties.
Close confidants of the royal family said the decision was a personal one taken by the Duke himself, who may now devote his time to writing his memoirs.