BEIJING: China wants to have deeper military ties with Afghanistan, a senior Chinese officer told a visiting Afghan envoy.

Fang Fenghui, a member of the powerful Central Military Commission which controls China's armed forces, told Mohammad Hanif Atmar, the Afghan president's national security advisor that their two armed forces had always had good relations, China's Defence Ministry said late on Wednesday.

China is willing to “deepen counter-terrorism intelligence, joint drills, personnel training and other areas of practical cooperation”, the ministry cited Fang as saying.

China is working with Pakistan and the United States (US) to broker peace talks to end a Taliban insurgency that has raged for 15 years in Afghanistan, but last month the militants refused to take part.

The US-led Nato mission ceased combat operations at the end of 2014, and has withdrawn most of its forces. China says it does not seek to fill a void left by their withdrawal.

However, China has promised to play a “huge” commercial role in helping rebuild the country, where the Taliban seek to re-establish their regime.

China is very nervous at the prospect of militants from its restive far western region of Xinjiang getting support from the Taliban and other groups in Afghanistan, Pakistan and central Asia.

Relations between Afghanistan and Pakistan, which prizes its long-time alliance with China, have been fraught with mistrust in the past.

For year, Afghan leaders repeatedly accused Pakistan of harbouring Taliban militants and covertly supporting their cohorts.

But the Taliban's recent refusal to join a peace process and ongoing offensive has raised doubts over how much influence Islamabad still exerts over the militants.

Atmar told Fang Afghanistan was willing to work with China to fight terrorism, and explained the Afghan role in combating the East Turkestan Islamic Movement, which Beijing blames for much of the violence in Xinjiang, the ministry said.

China's official Xinhua news agency said Atmar also met China's domestic security chief Meng Jianzhu, where they discussed counterterrorism too.

China's vice president last year pledged infrastructure and security support for Afghanistan, signing several deals during a rare high-level Chinese visit to Kabul.

Rights groups, however, blame unrest in Xinjiang on the frustration of the largely Muslim Uighur people from the region over China's controls on their culture and religion, charges Beijing denies.