The Princess Royal has taken the salute from the Household Cavalry Regiment at a parade to mark the end of its involvement in the Afghan conflict.
About 200 soldiers marched through Windsor from Combermere Barracks to the Guildhall.
It follows their return from the latest of six operational deployments of the regiment to Helmand Province.
Princess Anne also presented medals to about 40 soldiers at the barracks, after the parade.
Staff Cpl Paul Harris, 31, from B Squadron, who comes from Windsor, said the regiment carried out operations including seizing "tonnes of enemy homemade explosives and weaponry" during its recent six-month tour.
He added he was "privileged to work alongside the Afghan Army Tiger Teams" during the tour, whom he described as "brave, professional and charming soldiers".
'Closing a chapter'
Lt Col Jim Eyre, the commanding officer, said: "There is no doubt that we left Helmand a better place, where peace has a real opportunity to flourish.
"The regiment has earned this parade. We are closing a chapter and remembering fallen comrades before we look once more to the future."
Councillor Andrew Jenner, Mayor of the Royal Borough of Windsor and Maidenhead, also attended the parade along with members of the Band of The Blues and Royals.
Mr Jenner said: "The brave soldiers of the Household Cavalry have risked their lives in Afghanistan and this is our chance to show our gratitude and support."
Several central roads, including the High Street, were closed during the parade.