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".