BEIJING - Afghanistan and China pledged a long-term partnership Tuesday as new Afghan president Ashraf Ghani began a four-day visit while NATO combat troops prepare to withdraw from his country.

Ghani, once a US-based academic, was sworn in as Afghanistan’s new head of state last month in the war-torn Asian nation’s first democratic transfer of power. His first state visit as president is to resource-hungry China, which is seeking greater investment opportunities in Afghanistan. “We look at China as a strategic partner, in the short term, medium term, long term and very long term,” he told President Xi Jinping at Beijing’s Great Hall of the People. Xi’s “vision” for the continent had opened “not just a new chapter for Asia, but an entirely new book”, he said.

Hailing Ghani as “an old friend of the Chinese people”, Xi said he was prepared to work towards “a new era of cooperation in China-Afghanistan relations” to “take development to a new depth and breadth”.

China shares only a 76 kilometre (47 mile) border with Afghanistan’s remote far northeast, but has a keen interest in its neighbour’s mineral resources. It has already secured major oil and copper-mining concessions in Afghanistan, which is believed to have more than $1 trillion worth of mineral resources, according to studies by the US Geological Survey.

A residual force of around 12,000 soldiers, including 9,800 Americans and 500 Britons, will remain under a security pact signed by Ghani, focusing on training local forces and counter-terrorism. China will provide 1.5 billion yuan ($245 million) in “free assistance” to Afghanistan over the next three years, foreign ministry official Kong Xuanyou told reporters after Tuesday’s ceremony.

Kong said Ghani expressed “readiness and staunch support” in the struggle against “terrorist forces” - which Beijing blames for a string of attacks in its far-western Xinjiang region, the homeland of the mostly Muslim Uighur minority. China’s international role has come under criticism from some parties including US President Barack Obama, who in an August interview with the New York Times called Beijing a “free rider” for not doing more to quell violence in the Middle East.

Meanwhile, the Afghan Taliban on Tuesday claimed victory over Britain in southern Helmand province, crediting their fighters with killing hundreds and handicapping “tens of thousands” of troops in the “bloodiest attacks” of the 13-year war.

In a statement posted to their website, the insurgents thanked Taliban fighters for their “immense sacrifices”. “No doubt, the bloodiest attacks by mujahedeen during the past 13 years, forced the invading enemy to leave. The official statistics by the enemy puts British casualties at 500 soldiers however the actual number of casualties is more than the official figures. “These are the figures of life losses; the number of the handicapped soldiers reaches tens of thousands of troops.”

At least 17 Afghan police are missing after the Taliban made a new push to seize territory in the country’s northeast, officials said Tuesday. The Taliban militants, whose government was toppled by a US-led invasion in 2001, have intensified their attacks all around the country in recent months as NATO combat forces prepare to fully withdraw from Afghanistan by the end of the year.

The insurgents’ latest offensive began Saturday when they attacked the Wardoj district of Badakhshan province, interior ministry spokesman Sediq Sediqqi said.