Cameron landed in Camp Bastion in southern Helmand province, base for most British forces in Afghanistan, amid tight security and then headed north to visit soldiers at a base 40 miles away in the troubled Gereshk valley.
At a yard where troops were packing up military equipment to send home, he described the decision to bring nearly 4,000 British men and women home last year as a sign of success.
"We have a staged plan for drawing down our troops which is based on the staged plan for building up the Afghan army and the Afghan police force," he said. "Frankly the Afghan army is doing better than we expected, there's more of them than we expected and that's why we are able to bring home so many troops."
Cameron said this week that senior officers were impressed with the capabilities of Afghan forces, despite the setbacks of "green on blue" attacks this year in which 12 British troops have been killed by their Afghan colleagues.
Already 500 soldiers have departed in the first stage of a withdrawal that will leave just over 5,000 troops in the country in 2014, and no combat forces after that. Most UK bases and checkpoints in Helmand have already closed, although there is still fierce fighting in some parts of the province.
Philip Hammond, the defence secretary, conceded this week that the withdrawal of Nato forces would lead to "messy compromises", and that it is likely "some parts of Afghanistan will not be under central government control". He added: "It is not a perfect democracy and it never will be."
But the Afghan president, Hamid Karzai, on Thursday welcomed Cameron's announcement as a "timely decision" by the UK government. "Afghan security forces are prepared to ensure security and protect their country," the presidential palace said in a statement.
Cameron said the handover was in line with Afghan aspirations to secure their own country, while ensuring the UK had met its main security objective – preventing the country from becoming a base for al-Qaida or similar groups as it had been under Taliban rule over a decade ago.
"When I sit in No 10 Downing Street and look at where the plots that we face in terms of terror, where they come from, far fewer come from this part of the world than used to be the case when we first came to Afghanistan, so we have made real progress," he said.
British leaders have in the past spent tens of millions of pounds of aid on building up the Afghan government and state. Cameron said they would leave behind a struggling but improved place. "Well of course this is a deeply challenged country, it has huge levels of poverty and instability and problems," he said. "But it's a far better place than it was here when we came in 2001 – the economy has grown, there are more children in school, there are more health services available. And there is, crucially – because this is our main national interest – there's an Afghan army and an Afghan police force."
Heavy fog delayed the landing of Cameron's plane in Camp Bastion. After an overnight flight, the RAF C17 Globemaster military transporter he was travelling on circled the base for hours and then was diverted to nearby Kandahar airfield for refuelling.
The unexpected stop meant Cameron had to cancel some plans, including a trip to the post office to see Christmas post arriving. In the afternoon he headed to a small base on the Helmand river where he dined with troops.
He also remembered the 433 British troops who have died in Afghanistan, and the people they have left behind. "It is tough, it is difficult, we paid a high price and I once again pay tribute to all those who have fallen and their families and their loved ones who miss them so much."
A news blackout on the visit, enforced for security reasons, was lifted late on Thursday evening. Cameron's trip came just a few months after a Taliban suicide squad burst into the base, killing two US marines and torching Harrier jets worth hundreds of millions of dollars.
guardian.co.uk © Guardian News and Media Limited 2010
image: © University Hospitals Birmingham