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.
The marines gave three cheers, while the band played For He's a Jolly Good Fellow to see off the Duke, who waved and smiled as he closed a 70-year chapter of life in the public eye.
Known for his gaffes - including asking Aboriginal leader Ivan Brim on a 2002 visit to Australia "do you still throw spears at each other?" - the Prince is largely viewed in Britain as a loyal companion to the Queen.
"Well you can't change the weather and you can't change the Prince," former Royal Marine James Ellard said, as he waited for the Duke to appear behind the gates.
Ellard, who served seven years as a marine, said he was sad to see his captain go. His companion and fellow former marine for 12 years - Norman Saints - agreed, saying Prince Philip had been a good leader.
As the inspection finished the Duke made his way back inside the palace, while the crowd quickly moved on.
The parade in Buckingham Palace's forecourt was Prince Philip's 22,219th solo engagement since 1953. The Duke has been Honorary President of the Royal Navy and Royal Marines Associated and Club since 1948. The parade was the finale of the 1664 Global Challenge, which has seen 1500 Royal Marines and army commandos take part in a 2678km running challenge over the past four months.
The Duke, who is the longest-serving consort in British history and also the oldest serving partner of a reigning monarch, is reported to be in good health. Buckingham Palace said the 91-year-old Queen's schedule will continue, and her husband may join her at official events, but "Team Windsor" - Prince William, his wife Catherine and Prince Harry - are increasingly stepping up their royal duties.