The Union flag has been ceremoniously lowered for the last time during a sunset ceremony at Wootton Bassett.
It will be stored in the local church overnight before being handed over to RAF Brize Norton in Oxfordshire, which will be the new base for all defence repatriations.
Earlier, David Cameron offered a “heartfelt thank you” to the people of Wootton Bassett for honouring fallen British troops over the past four years.
Speaking during a visit to the Mini factory in Oxford, the prime minister said: “My message to the people of Wootton Bassett is a really big, heartfelt thank you on behalf of the Government and the whole country.”
Mr Cameron said the town’s residents “have done our country proud with the respect and admiration and passion they have shown for our Armed Forces and those who have tragically fallen in battle in Afghanistan and elsewhere.”
He said he had asked to be driven the route that families will take under the new arrangements for the repatriation of fallen British servicemen at RAF Brize Norton.
Asked about concerns that there would be less opportunity for members of the public to pay their respects to the dead under the new arrangements, he said:
“The route that’s been chosen has been chosen sensitively and carefully. I hope people will give this a chance to see if it works.”