Prince Philip, who turns 96 in June, made the decision himself and the Queen supported him, a spokesman said.
"I'm sorry to hear you're standing down", one man told him at a royal lunch on Thursday. "Well, I can't stand up much," the duke quipped.
The duke will attend already 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.