Troops from the Royal Scots Borderers returning from Afghanistan are to stage a series of homecoming parades.
The battalion plans to march through Galashiels on Saturday, followed by similar events in Linlithgow, Colinton and Edinburgh city centre.
Commanding officer Lt Col Charlie Herbert said they had left a "very rich legacy" in Afghanistan.
But there was also "sadness" at the loss of L/Cpl Joseph Pool, who was killed during the tour of duty.
About 400 soldiers from The Royal Scots Borderers (1 Scots) were sent to Helmand province in March, where they were involved in training and mentoring the Afghan security forces.
They have now arrived back at their base in Edinburgh and are preparing for a series of homecoming parades through the Scottish capital and surrounding towns.
Lt Col Herbert said the soldiers had achieved a great deal during their time in Afghanistan.
He said: "They threw themselves into it with complete heart and soul and I'm unbelievably proud of each and every one of them.
"We lived, we trained, we ate, we slept, we fought and sometimes we bled alongside our Afghan colleagues."
He said their work was "absolutely critical".
"If we're going to succeed with this campaign - which we will - we've got to get the Afghan army and the Afghan police to the stage where they can take over security and responsibility," he said.
"We worked very hard with them and we've got them to a point where they are now leading operations in Helmand.
"It's been a successful tour and I think we've left behind a very rich legacy."
L/Cpl Joseph Pool, from Dumfries but who lived in Greenock, was killed in action following an exchange of fire with insurgents on 5 September.
Lt Col Herbert said: "I think as we come back and see our families and to a certain extent we celebrate our return, it's a time when our thoughts also wander to the families of those whose lives have changed forever, the sacrifices that have been made.
"It isn't just those that have been killed.
"There are a number of fine young men whose lives have changed with very, very serious injuries.
"There's definitely an element of sadness at this time."
The battalion plans to march through Galashiels on Saturday, before marching in Linlithgow on 13 October, Colinton on 15 October and Edinburgh city centre on 16 October.
Lt Col Herbert said: "It's nice for the soldiers actually to see the degree of public support which is out there.
"But it's also an opportunity for us to say 'thank you' to all of the locals around Edinburgh and across Scotland for the support that they continue to give us."