The event marked the end of the 1664 Global Challenge, in which Marines from around the world have taken part in extreme events such as 34-mile swim underwater and long-distance running to raise money for the Royal Marine Charity.
He was also met with cheers as he was handed the Challenge baton.
This came even as the Duke of Edinburgh, 96, prepared for his final solo engagement in a ceremony at Buckingham Palace, before enjoying time away from the hectic royal schedule.
Philip, however, may pop up at public events from time to time, such as Trooping the Colour in future years or even support the Queen during the proposed state visit for U.S. president Donald Trump.
It is one of more than 780 organisations of which he has been patron, president or a member.
The palace notes that Prince Philip has carried out 22,219 solo engagements and 637 solo overseas visits since 1952, in addition to authoring 14 books and delivering 5,496 speeches.
Pulwama encounter: Two Hizbul terrorists neutralised, ammunition recovered
The officer said one person, whose identity is being ascertained, was hit by a bullet in the shoulder and rushed to a hospital. Two militants were killed in an encounter with security forces in south Kashmir's Pulwama district on Sunday, officials said.
The royal will remain by his wife's side for some public events, and he will continue to keep up select official duties, including correspondence.
While Prince Philip's life had not turned out as expected, Brandreth said the duke once told him: "I tried to make the best of it".
"However, Palace insiders have said the Duke specified he wanted a "low key" funeral at St George's Chapel, Windsor Castle, where he will also be interred".
The palace said Philip may still choose to attend events alongside the queen.
Elizabeth has called Philip, her husband of nearly 70 years and the longest-serving consort in British history, "my strength and stay".
Prince Philip has spent 52 days this year carrying out public engagements - more than the Queen and the Duke and Duchess of Cambridge.
British media reported earlier this year that the Duke's grandson, Prince Harry, will take over the role, but the final decision lies with the Queen.