The Ministry of Defence confirmed Harry's role this afternoon - only after he had safely left Kandahar - after he was notably absent from the Remembrance Sunday commemorations in Whitehall which included his brother.
There are just a few hundred remaining troops in Afghanistan, where their combat role officially came to an end on October 26.
Harry served in Afghanistan twice, but his maiden deployment had to be cut short after a foreign publication broke a strict media blackout on details of his whereabouts.
The Prince lined up with fellow servicemen to hear The Last Post and Reveille played by musicians from the Royal Artillery Band.
After the service he met personnel from Joint Force Support (Afghanistan) and 904 Expeditionary Air Wing, including members of 31 Squadron RAF serving their final tour of Afghanistan.
He climbed into the cockpit of a Tornado GR4 and learned how the jet has served in recent operations, a Ministry of Defence Spokesman said.
The Prince, whose second deployment was as an Apache helicopter co-pilot and gunner, was the first royal to see active combat since his uncle the Duke of York fought in the Falklands.
Since his two tours of duty the Prince, a captain with the Blues and Royals since 2011, has quit the Army Air Corps for a desk job organising events including the Invictus games for wounded servicemen.
A royal spokesman said: 'Prince Harry was honoured to be able to attend the last remembrance service in southern Afghanistan, especially given his personal experience of operational service.
'He felt it important to mark this significant milestone, remembering all those who have lost their lives during the campaign.'
There was a sombre atmosphere today as the remaining troops in Afghanistan remembered the 13-year fight which has claimed more than 450 British lives.
International Security Assistance Force (ISAF) personnel and civilians gathered for remembrance services in Kabul and Kandahar - likely to be the last involving British military based in Afghanistan.
The ceremony in Camp Souter Kabul today was led by the Reverend Dr Jim Francis CF and attended by personnel from all three services, along with senior representatives from the international coalition.
Camp Bastion in Helmand is due to close in a few weeks and the final British troops are due to be pulled out of Afghanistan by the end of the year.
- Daily Mail