* China focus shifts from Afghan investment to security
* U.S. troop withdrawal creates vacuum, opportunity
* Beijing wary of Uighur separatists active in region
By Katharine Houreld and Ben Blanchard
KABUL/BEIJING, April 14 (Reuters) - China is quietly preparing for a more robust role in the future of Afghanistan, concerned that the withdrawal of NATO troops will leave a hotbed of militancy on its doorstep.
The two countries are connected by a narrow mountainous corridor that is almost impassable, which meant Beijing could focus on mining and mineral deals in Afghanistan as Western forces battled Taliban insurgents. But officials say that China is emerging as a key strategic player.
In August it will host a "Heart of Asia" conference on Afghanistan, which may have a newly elected president by then, inviting leaders from regional nations including India and Pakistan. A Western diplomat said China has already held discreet trilateral talks with Afghanistan and other countries.
One of its chief worries is that Uighur militants who want a separate state in western China's Xinjiang region will exploit the security vacuum left after the bulk of NATO forces withdraw by the end of the year to step up their fight.
Hundreds of Uighur fighters are believed to be holed up in rugged, lawless tribal areas straddling Afghanistan and Pakistan.
In a rare interview from an undisclosed location last month, their leader told Reuters that China would be made to pay for its crackdown on separatists in Xinjiang.
"In the past we said: 'The Americans are there, and the Americans don't want anyone else, especially not another great power, taking their place'," said Hu Shisheng, a South Asia expert at a government-backed think tank, the China Institute of International Relations in Beijing.
"Now with the U.S. strategic focus shifting, neighbouring countries cannot just let Afghanistan descend into chaos.
"The Pakistan and the Afghanistan Taliban are sympathetic towards the Uighurs. So we absolutely have to pay attention to this, in a way that perhaps we did not before," he said.
FOCUSED ON ECONOMICS
So far, China's commitment to Afghan reconstruction since the ouster of a hardline Islamist Taliban regime in 2001 has been around $250 million and its security support has been mostly limited to counter-narcotics training.
China has a $700 million agreement to drill for oil in the Amu Darya Basin and a $3 billion deal to develop the Aynak copper mining project. But insiders say security concerns, not investment, are the primary driver of China's new focus.
"They were focused on economics, not reconciliation or peace. But recently they have expressed their willingness to get more involved in the peace process," said a member of the High Peace Council, an Afghan government body overseeing negotiations with the Taliban.
The Chinese and U.S. embassies in Kabul declined to comment.
It is highly unlikely that China will follow the U.S. lead and send soldiers into Afghanistan.
Officials believe, however, that, with the West's attention on the region set to fade, Beijing has an opportunity to flex its diplomatic muscle, using warm relations with Afghanistan and Pakistan to ease suspicion between the two neighbours.
Kabul has long accused Islamabad of providing havens for militants and sponsoring attacks inside Afghanistan, and now Pakistan believes Afghanistan is doing the same. A decade of U.S. diplomacy has failed to reconcile the two sides.
Afghan Deputy Foreign Minister Ershad Ahmadi said China had given assurances that it would encourage Pakistan to cooperate with Kabul's efforts to make peace with the Taliban.
"We trust them. We are working on a plan," he told Reuters.
"DUMPED ON THEIR LAP"
China's push for a bigger role in Afghanistan is seen by some diplomats as an attempt to show it is a responsible global actor after rattling its own neighbours by asserting claims in the South China Sea.
But Andrew Small, a fellow at the German Marshall Fund and author of an upcoming book on Chinese-Pakistan relations, said it is driven by a realisation that its own security is at stake.
Four years ago, Washington proposed several joint projects, including the construction of schools by China in Aynak - near its proposed copper mines - and teacher training by the U.S. side. It took China almost two years to respond, Small said.
Now the two countries work together training Afghan diplomats.
"At the end of 2011, the Chinese realised America was leaving and they were getting this dumped on their lap," he said. "Until then, China had sat completely on the sidelines. They just used to send people to read out statements in meetings."
A Beijing-based Asian diplomat cautioned, however, that Beijing's new enthusiasm for engagement with Kabul might run into trouble, especially as its officially atheist Communist leaders have limited experience dealing with Muslim countries.
"Afghanistan is highly factional, and it's not like any other Islamic country," he said. "China is going to have a very difficult time." (Editing by John Chalmers and Mike Collett-White)