An Army battalion has become the first from England to be granted the freedom of the city of Edinburgh.

The 3rd Battalion The Rifles marked the honour by marching down the Royal Mile in the Scottish capital.

The parade also marked a recent return from operations in Afghanistan, where they spent six months in Helmand province.

The battalion has been based at Redford Barracks in the city since 2003 and traditionally recruits mainly from the north of England, as well as Shropshire, Herefordshire and the south west of England.

Commanding officer Lieutenant Colonel 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."

People cheered the soldiers as they marched to the sounds of a military band down the historic street between Edinburgh Castle and the Palace of Holyroodhouse.

In Afghanistan, the soldiers trained and mentored Afghan security forces, as well as taking on other roles.

The battalion lost Lieutenant Andrew Chesterman on August 9 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 last tour of Afghanistan in 2010.

A private military church service was held on Friday in Colinton Church near the barracks.