Chancellor Gordon Brown has told UK troops in Afghanistan they are fighting on one of the "frontlines against international terrorism".
Gordon Brown praised the 'bravery' of troops fighting the Taleban
Mr Brown is visiting Camp Bastion, Helmand in the south of the country to meet military commanders and local political leaders.
During the surprise visit, he praised troops for their "great courage and bravery" in fighting the Taleban.
He also announced further investments in Merlin and Chinook helicopters.
The chancellor ate lunch with personnel at what is the UK's largest base in Afghanistan, telling them: "It's good to see you. It's much appreciated, what you are doing."
Mr Brown announced an extra £400m for military operations in Afghanistan and Iraq in his Budget last week.
His officials confirmed plans to purchase six new Merlin helicopters from the Danish government and to refit eight Chinook helicopters - at a total cost of around £230m.
Mr Brown said there was no doubt about the UK's "long-term commitment" to help Afghanistan achieve a "democratic nation".
"Achieving security must be our first priority but, as we have learnt elsewhere, economic development will also be essential to long-term peace.
"The UK will continue to support development and reconstruction projects and work with the Afghan government to build a sustainable future."
Mr Brown is expected to announce a further £15m in aid to Afghanistan to be spent on so-called "quick impact projects", such as developing village wells and water supplies.
The government announced in February that it would boost UK troop numbers in Afghanistan this year, with a total of 7,700 being stationed there by summer.
The troops will continue to operate in Kandahar and Helmand, as well as working in Uruzgan, Zabul, Nimruz and Day Kondi.
BBC News 24's chief political correspondent James Landale said the chancellor's visit to Camp Bastion is clearly the latest stage of his preparations to succeed Tony Blair as prime minister.
It comes four months after he made his first trip to visit British troops in Iraq.
During his visit, Mr Brown also condemned Iran's treatment of detained Leading Seaman Faye Turney as "cruel, callous, inhuman and unacceptable".
He said a UN resolution calling "definitively for their release" was "the unanimous view of the international community".