BRITISH troops have marked the end of their 13-year combat operation in Afghanistan with a moving ceremony which saw the Union flag lowered in Camp Bastion for the last time.

UK forces handed the army base over to Afghan officials yesterday, bringing an end to the long-running conflict which has claimed the lives of 453 British service personnel.

Brigadier Robert Thomson, the most senior British officer in Helmand, said he was proud of what had been achieved and happy to be going home to his family, but added that he was sad about every serviceman and woman who had died in Afghanistan.

"I'm optimistic about this ­country," he said. "What we have achieved is something that we can be proud about. The people voted and the Taliban have been marginalised.

"There is never an easy time to leave a country when you've been building an institution.

"This is a country that is a work in progress rather than a country that has been completed."

David Cameron added that ­Britain will continue to remember those who gave their lives in the conflict.

He tweeted: "I made a commitment that I would get our Armed Forces out of Afghanistan by 2015 and today sees the end of combat operations in the country.

"We will always remember the courage of those who served in Afghanistan on our behalf and never forget those who made the ultimate sacrifice."

British and American troops stood side by side during the poignant ceremony, watching as both the Union flag and the Stars and Stripes were lowered at the base.

The UK is preparing to withdraw combat personnel entirely from Afghanistan by the end of the year and is next expected to hand over a base in Kandahar, the country's second largest city.

Several hundred military advisers and trainers will remain in the capital Kabul after the end of the year, but Secretary of State for Defence Michael Fallon insisted that under no circumstances will British combat troops be deployed in Afghanistan again.

Mr Fallon added that the campaign had given Afghanistan the best possible chance of a stable future, but later admitted that there was "no guarantee" that it would remain safe.

He said: "We have denied Afghanistan as a safe haven for terrorism and terrorist atrocities that could take place in Britain and western Europe.

"To that extent the mission has been accomplished in Afghanistan but there is no guarantee that Afghanistan is going to be stable and safe.

"What we are saying to you is that we have given Afghanistan the best possible chance of a safer future, primarily through the sacrifice of our own troops and other Nato troops in building up the Afghan army itself."

Looking back on Britain's campaign there, which began in October 2001 when troops were deployed as part of the Nato response to the September 11 terrorist attacks in the US, Mr Fallon admitted that "mistakes" had been made.

He said: "I think the generals have been clear that mistakes were made. Mistakes were made militarily and mistakes were made by the politicians at the time.

"Clearly the numbers weren't there at the beginning, the equipment wasn't quite good enough at the beginning, and we have learnt an awful lot from the campaign.

"But don't let's ignore what has been achieved. We have now some six million people in school in Afghanistan, three million of them girls.

"There is access in Helmand to healthcare and to education in that province that simply didn't exist 10 years ago."

At the peak of the Afghan conflict there were 10,000 British personnel in Helmand. However, this had diminished to a few hundred in recent months as thousands of soldiers returned to Britain.

In recent months, hundreds of military vehicles and shipping containers with kit have also been brought back to the UK.

Camp Bastion's runway - at one point the fifth busiest UK-operated airstrip - is now expected to handle commercial flights.