"These border areas between Afghanistan and Pakistan are the breeding ground, the crucible of terrorism," he said.
"A chain of terror links these areas to the streets of many of the capital cities of the world.
"Our strategy for working with both the governments of Afghanistan and Pakistan in tackling this terrorist threat will be complementary.
"We will tackle it because security in these mountainous border areas, which may seem distant and remote from home, will mean more security in Britain."
Mr Brown said he and President Karzai would "jointly work" on "eradicating terrorism" in the border areas.
Announcing money to support elections in Afghanistan, Mr Brown said it was "absolutely important" that while progress had been made on Afghan elections and infrastructure it was important to "defeat international terrorism and hold it back from here in Lashkar Gar, here in Helmand province, but also on the other side of the border in Pakistan".
On his visit to Camp Bastion Mr Brown was given a briefing by Brigadier Tim Radford, commander of Task Force Helmand and took part in a meeting of local community leaders including Helmand's governor Gulab Mangal.
US Defense Secretary Robert Gates has warned Pakistan that relations with the US will be threatened unless Islamabad combats the rise of the Taleban.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.