3rd Battalion The Rifles granted freedom of Edinburgh
Thousands of people lined Edinburgh's Royal Mile to watch soldiers from the 3rd Battalion The Rifles take part in a homecoming parade.
During the event they received the freedom of the city - the first English battalion to be awarded the honour.
The soldiers recently completed a six-month tour of Afghanistan, where they were deployed in Helmand Province.
The battalion traditionally recruits in England but has been based at Redford Barracks in Edinburgh since 2003.
Commanding officer Lt Col Charlie Maconochie said: "It is a great honour and privilege that the council and the people of Edinburgh have decided to bestow such a high accolade. We are hugely proud of our association with Edinburgh and view this very much as our home.
"The battalion deployed on operations to Afghanistan in March this year, returning throughout October. Receiving this civic award shows the soldiers how much their efforts are appreciated by the people of Edinburgh, something every rifleman will be immensely proud of.
"We are extremely grateful to the local community in Colinton and Edinburgh for all the support we received during the tour.
"The homecoming parade gives families, friends and supporters a chance to see my riflemen receiving thanks from their local community. The soldiers are now looking forward to a well-earned break with their loved ones after a challenging but hugely successful deployment."
The soldiers were cheered as they marched to the sounds of a military band down the historic street between Edinburgh Castle and the Palace of Holyroodhouse.
During their six months in Afghanistan, the soldiers trained and mentored Afghan security forces, as well as taking on other roles.
The battalion lost Lt Andrew Chesterman on 9 August while on patrol in the Nad 'Ali district.
Lt Chesterman, from Bristol, was commanding a vehicle patrol when the lead vehicle struck an improvised explosive device. He was shot and later died at Bastion Hospital, the Army said.
Col Maconochie said: "Lieutenant Chesterman was an outstanding Rifles officer and always led from the front. His death has left a huge hole in the battalion."
Edinburgh Lord Provost Donald Wilson said: "Conferring the privilege upon this fine and historic battalion is a clear and fitting demonstration of Edinburgh's steadfast support for the brave men and women who put their lives at risk in service of this country."
The battalion lost 14 members during its previous tour of Afghanistan in 2010.
A private military church service was held on Friday in Colinton Church near the barracks.