The decision was made by Prince Philip himself and is supported by the Queen, a palace spokesman said.
The duke, who turns 96 next month, will attend previously scheduled engagements between now and August but will not accept new invitations.
The Queen “will continue to carry out a full programme of official engagements”, the palace said.
The duke carried out 110 days of engagements in 2016, making him the fifth busiest member of the royal family, according to Court Circular listings.
He is patron, president or a member of more than 780 organisations and will continue to be associated with them, but “will no longer play an active role by attending engagements”, Buckingham Palace said.
In the statement, the spokesman said the duke “may still choose to attend certain public events from time to time”.
BBC royal correspondent Nicholas Witchell said the duke “clearly feels he now wishes to curtail” his “familiar role” in support of the Queen.
He added: “The Queen is going to continue, of that there is no doubt. She will continue, albeit with a somewhat lightened workload.”
The duke attended Lord’s Cricket Ground to open a new stand on Wednesday and was heard joking at the event that he is the “world’s most experienced plaque unveiler”.
He is famed for off-the-cuff remarks he has made at royal engagements around the world over the years.
Prime Minister Theresa May said she offered the country’s “deepest gratitude and good wishes” to the duke following his announcement.
She added: “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.”
Labour leader Jeremy Corbyn wished the duke “all the best in his well-earned retirement”, saying: “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.”
Prince Philip set up the awards in 1956 and they have become one of the UK’s best-known youth programmes, with young people carrying out challenges to earn bronze, silver or gold awards.
The duke and the Queen celebrate their platinum wedding anniversary – their 70th – in November.
They have called a halt to long-haul travel in recent years, with younger royals carrying out those duties.
On Thursday, he and the Queen are due at a service for members of the Order of Merit at the Chapel Royal at St James’s Palace before hosting a lunch for those attending.
Royal commentator Dickie Arbiter said the duke is in “robust health”, adding: “He is not giving up on life, just stepping [down] from full-time public engagements”.