The last UK base in Afghanistan has been handed over to the control of Afghan security forces, ending British combat operations in the country.
The union flag was lowered at Camp Bastion, while Camp Leatherneck - the adjoining US base - was also handed over to Afghan control.
Defence Secretary Michael Fallon said "mistakes were made" but much had been achieved since troops arrived in 2001.
The number of deaths of British troops throughout the conflict stands at 453.
Camp Bastion, in Helmand Province, has been UK troops' main Afghan base since 2006.
The last US Marines unit in Afghanistan ended its combat operations with the handover of Camp Leatherneck. So far, 2,349 US military personnel have died in Afghanistan.
Mr Fallon said: "It is with pride that we announce the end of UK combat operations in Helmand, having given Afghanistan the best possible chance of a stable future.
"Our armed forces' tremendous sacrifice laid the foundations for a strong Afghan security force, set the security context that enabled the first democratic transition of power in the country's history, and stopped it being a launch pad for terrorist attacks in the UK."
Speaking on the Andrew Marr Show on BBC One, he said the Taliban had not been defeated, but Afghan forces were now taking "full responsibilities".
Mr Fallon said UK support would continue through "institutional development", the Afghan National Army Officer Academy and development aid.
Speaking about the UK military mission, he said: "Mistakes were made militarily, mistakes were made by the politicians at the time and this goes back 10, 13 years.
"Clearly the numbers weren't there at the beginning, the equipment wasn't quite good enough at the beginning and we've learnt an awful lot from the campaign.
"But don't let's ignore what has been achieved."
Mr Fallon said the "vast bulk" of UK troops would be home by Christmas, with a "few hundred" staying to help with training at the officer academy.
"We're not going to send combat troops back into Afghanistan, under any circumstances," he added.