The Grenadier Guards spent six months in Helmand Province
The Queen has presented new regimental colours to the 1st Battalion Grenadier Guards at Buckingham Palace.
The infantry unit, famed for ceremonial roles at events like Trooping the Colour, returned from a six-month deployment to Afghanistan in April.
During the ceremony, the Queen paid tribute to five servicemen killed in action, including the battalion's Regimental Sergeant Major Darren Chant.
She said the nation owed them an "immense debt of gratitude".
At the ceremony, around 550 Guardsmen marched in their famous red tunics and bearskins from Wellington Barracks into the gardens of Buckingham Palace for inspection by the Queen.
During the presentation, the Queen, who was joined by the Duke of Edinburgh, praised the regiment for doing "extremely well" in Afghanistan.
She said: "Attempting to establish political stability and good government takes a special kind of courage and commitment, and puts extreme pressure on all ranks all the time.
"Every one of you can be immensely proud of this record of courage and determination."
The Queen added: "To the wounded, and their families, and to the families of those who have been killed, the whole country owes an immense debt of gratitude and sympathy."
The new Queen's colour has also been chosen as the standard which will be paraded at the Trooping the Colour ceremony in June.
Flags were used as a rallying point in battles for centuries, and are still seen as the symbolic heart of regiment.