The Queen and members of the royal family, including Prince William and Kate Middleton, joined army top brass and relatives of British soldiers who died in Afghanistan at a commemoration service at St Paul's Cathedral in London, marking the end of 13 years of British military operations in the country.
Also present was the Queen's grandson Prince Harry, who served two tours of duty in Afghanistan.
During the service, the Archbishop of Canterbury, spiritual head of the Church of England, blessed a cross made of shell casings that previously adorned a memorial wall at Camp Bastion, the main hub of the British military in Afghanistan.
The Queen and members of her family take part in a Service of Commemoration for troops who were stationed in AfghanistanKirsty Wigglesworth/PoolA cross made from used artillery shell cases is brought to the altar by servicemenJohn Stillwell/PoolThe Queen meets Josh Campbell, formerly of the Royal Logistics Corps who lost both legs in an IED strike in AfghanistanKirsty Wigglesworth/PoolAn injured serviceman attends the memorial serviceJohn Stillwell/Pool
Also among the congregation was Tony Blair, who as prime minister in 2001 took Britain into the US-led coalition that invaded Afghanistan and toppled the Taliban government in response to the September 11 attacks on New York and Washington.
Former prime ministers Tony Blair and Gordon BrownBen Stansall/AFPDavid Cameron attends the Service of CommemorationJeremy Selwyn/PoolDeputy prime minister Nick Clegg and leader of the opposition Ed MilibandJeremy Selwyn/Pool
Britain lost 453 servicemen and women in Afghanistan out of the 140,000 who served there over the years. The last combat troops left in October last year, leaving behind only about 500 trainers and advisers assisting the Afghan security forces.
The government says the long war stopped Afghanistan from being used as a safe haven for militants to plan attacks on British streets, and that Afghanistan is now a safer and more prosperous country than it was before.
However, the war remains controversial in the eyes of some Britons, who say its objectives were not articulated clearly enough and Britain paid too high a price for what was achieved.
A wounded serviceman arrives for the service of commemoration at St Paul'sStefan Wermuth/ReutersA young boy wearing medals arrives for the Afghanistan service of commemoration at St Paul's CathedralStefan Wermuth/Reuters
The service was followed by a military parade through the City of London and a flypast of aircraft used in the campaign, including Chinook, Apache and Sea King helicopters and Hercules and Tornado airplanes.
A Royal Air Force Chinook flies over London during a Service of Commemoration for troops who were stationed in AfghanistanCarl Court/Getty ImagesMembers of the royal family, politicians, military personnel and other guests gather outside St Paul's Cathedral for the flypastBen Stansall/AFPService-goers watch a flypast outside St Paul's CathedralChris Jackson/Getty Images