British forces Sunday handed over formal control of their last base in Afghanistan to Afghan forces, ending combat operations in the country after 13 years which cost hundreds of lives.
The Union Jack was lowered at Camp Bastion in the southern province of Helmand, while the Stars and Stripes came down at the adjacent Camp Leatherneck -- the last US Marine base in the country.
All NATO combat troops will depart Afghanistan by December, leaving Afghan troops and police to battle Taliban insurgents on their own.
The huge joint base built in the desert near the provincial capital Lashkar Gah was the most important installation for the NATO mission in Afghanistan.
Between 2010 to 2011, it housed almost 40,000 foreigners including sub-contractors.
Hundreds of US Marines and British troops are set to leave Helmand soon, though the precise date has not been revealed for security reasons.
In a ceremony Sunday the Afghans took formal control of the base, despite already being present in a portion of it. Britain's Union Jack and the Stars and Stripes were lowered, leaving only Afghanistan's national flag to flutter in the breeze.
Many facilities such as pipelines, buildings, roads and even office furniture remain in place, with the US alone estimating $230 million worth of equipment is being left behind.
Marine General Daniel D. Yoo, regional commander, said the Afghan army is now now capable of taking over the reins.
"I'm cautiously optimistic they will be able to sustain themselves. I know from my experience that they have the capability and the capacity if they allocate the resources properly," he said.
"We're very proud of what we've accomplished here," added the officer, who was among the first Marines on the ground in autumn 2001, when a US-led coalition toppled the Taliban who had been in power since 1996.
General Sayed Malook, who leads the Afghan forces in the region and has now established his quarters in the base, said the camp would become a military training centre and house 1,800 soldiers.
"I'm certain we can maintain the security," he said Sunday. Asked about the departure of the NATO troops, he said: "I'm happy and sad. I'm happy because they are going to their home, I'm sad because they are friends."
After Camp Leatherneck and Bastion, the most important NATO bases will be at Kandahar, Bagram, Herat and Mazar-e-Sharif.
There are now about 40,000 foreign troops in Afghanistan, down from their 2011 peak of around 140,000.
A residual force of around 12,000 soldiers including 9,800 Americans will remain after December as part of a security pact signed by new president Ashraf Ghani.
A total of 453 British troops and 2,349 Americans have died in the fighting.