The British troops who died in Afghanistan will never be forgotten, the prime minister has said at the end of the UK's 13-year military campaign.
The last British base, Camp Bastion, was handed over to Afghan security forces in a ceremony on Sunday.
David Cameron : "We will always remember the courage of those who served on our behalf."
But former deputy prime minister Lord Prescott has questioned whether the results "justified" the 453 UK deaths.
The union flag was lowered at the ceremony at Camp Bastion in Helmand province on Sunday morning, while Camp Leatherneck - the adjoining US base - was also handed over to Afghan control.
"13 years of war haven't ended in victory for either side" the BBC's John Simpson concludes
The UK forces were part of a US-led coalition which toppled the ruling Taliban in 2001, following the 9/11 attacks, and Bastion has been the UK's main Afghan base since 2006.
The Chief of the Defence Staff, Gen Sir Nick Houghton, said the UK's armed forces had "played a hugely significant role in delivering a security legacy for the people of Afghanistan".
The UK's most senior officer in Helmand, Brig Rob Thomson, said Sunday's ceremony marked the "final step in a deliberate, responsible and measured handover" to the Afghans.
He told the BBC: "There is regret over every single serviceman who has lost their life in this country and all those who have been wounded and we hold them in our hearts to the very end of our days.
"But what I can tell every single member of the armed forces who served here and every single family who have sent their loved ones here is that we have made a difference."
Writing in the Daily Mirror Lord Prescott, who was in the cabinet that sent British troops to Afghanistan in 2001, said he "gratefully welcomed" the return home of service personnel.
"I respect the thousands of gallant men and women who went to Afghanistan and Iraq to save lives and restore peace," he said.
"But they teach us that being the world's policeman carries a heavy price and does not justify the heavy loss of lives."
Ian Sadler, of the Military Families Support Group, said UK troops "could have come out a lot sooner".
Mr Sadler, whose son Jack was killed in Afghanistan in 2007, said Britain should not have tried to "construct a new nation" in Afghanistan.
"The Afghan national army and the Afghan national police will not be able to cope and the Taliban will come back to carry on with their drugs harvest," he warned.
Defence Secretary Michael Fallon hails the "tremendous sacrifice" made by British troops
Defence Secretary Michael Fallon told the BBC that troops were coming home with their "heads held high", having helped make Afghanistan a "much better place".
He said the country was no longer a "safe haven" for extremist group al-Qaeda and Afghans now had a "chance of a better future".
He said there was "no guarantee" Afghanistan would "be safe and stable forever" but the Afghan government now had 300,000 soldiers and police officers.
Asked if the Afghan army might collapse, as parts of the Iraqi army did in the face of Islamic State militants, Mr Fallon said Iraq's forces were "seen as sectarian" while the Afghan army had the "support of the whole population".
He said the UK was not "walking away entirely" and would continue to give help and support, including financial aid and military training.
UK troops in Afghanistan
UK troops served
Total operational cost
UK troops killed
died in 2009 - the worst year
mentors staying on
Maj Gen Richard Nugee, one of Britain's highest ranking commanders in Afghanistan, said Afghan forces had proved they could "hold their ground" and defeat the Taliban.
Asked about Britain's 13-year military operation, he added: "Was it worth it? It's always difficult to say for those who have lost people here, but actually this country is a far better place and I believe we're safer in Britain."
Labour leader Ed Miliband said: "All those who served did so to help ensure Afghanistan could no longer be used as a safe haven for terrorists."
Jack Straw, foreign secretary from 2001-06, said the UK had been wrong to lead international efforts against Afghanistan's opium trade.
He it had been "very much a diversion", adding: "You have got to make a choice about which front you fight on."
In 2001, then prime minister Tony Blair said more than 90% of the UK's heroin came from Afghanistan's opium poppies.
He said the Taliban was "funded by the drugs trade" and it was "another part of their regime we should seek to destroy."
A US report last week suggested Afghan opium cultivation had increased significantly since 2001 and hit record levels last year, with 209,000 hectares of opium poppies grown.