As the disappearance of flight MH370 dominated the headlines across China, a party of senior US officials and AfPak experts arrived in Beijing last week for discreet talks with their Chinese counterparts. They were there as part of a little reported but crucial new Sino-American dialogue on Afghanistan, discussing the role China could play there after the US withdrawal. It is an important development in the new Great Game that is already realigning the delicate geopolitical balance of the region.

The public standoff between the world's two greatest military powers in the South China Sea over the Senkaku/Diaoyu islands has disguised a growing detente between them both over central Asia. "The Chinese are very much aware that we are now on the same page in Afghanistan," I was told by a senior state department official with the delegation. "Our interests are now in almost complete alignment there."

The fledgling dialogue received a huge boost earlier this month when China suffered what one newspaper affiliated with the party described as "China's 9/11". A knife attack by a group of eight militants at Kunming station in Yunan province left 29 dead and 140 injured. The authorities stated that the assailants were Uighurs, the Turkic-speaking Muslim minority, many of whom want independence for the northwest region of Xinjiang – or East Turkestan, as Uighurs call it.

Tensions between Uighurs and Han Chinese have been simmering for years. The Chinese have bulldozed great swaths of Kashgar, the historic Uighur capital, and drafted hundreds of thousands of Han Chinese into the sensitive border region. Like the Tibetans, the Uighurs now find themselves a minority in their own homeland.

In 2009 riots between Uighurs and Han in the regional capital of Urumqi left more than 100 dead. In October 2013, a vehicle carrying three Uighurs ploughed into pedestrians near Tiananmen Square, killing two and wounding 40. The Chinese authorities said the attack was the work of the East Turkestan Islamic Movement (Etim), a militant Uighur group they say has links to the Taliban and Pakistani jihadi networks. Last week there were was much gossip in China of a possible Etim hijacking in the case of flight MH370.

This may well prove illusory, and American intelligence does not believe that the Uighur militant presence in Afghanistan or Pakistan is very large: "There must be some Uighurs there," I was told by a US delegation member last week. "But the Chinese overdo it. The Uighurs are certainly not as significant a presence as the Uzbeks, who are definitely there and are genuinely a threat." The primitive nature of the Kunming attack – using knives not guns or bombs – would seem to confirm that the Uighurs may be angry but they remain largely untrained and unarmed.

Nevertheless, the perceived Pakistan link to Uighur militancy has become the crucial factor in changing the Chinese approach to Afghanistan. Five years ago the Chinese viewed the country primarily as a source of hydrocarbon and mineral deposits – trillions of dollars of the oil, gas, copper, iron, gold and lithium that China will need if its economy is to expand. In 2008 Chinese Metallurgical Group and Jiangxi Copper Co bought a 30-year lease on the site of Mes Aynak in Logar for $3bn, which they estimated to be the largest copper deposit in the world. But after Taliban attacks the mine remains dormant, and Beijing now views Afghanistan more as a security problem than an economic opportunity: "Driving Chinese policy in Afghanistan now are concerns on terrorism," said the state department official.

In September 2012, the then Chinese public security chief, Zhou Yongkang, visited Kabul, the first such visit by a Chinese minister – and announced a major turnaround in policy. China began security co-operation with President Hamid Karzai's regime, training 300 Afghan police officers. Since then the US and China have collaborated in training Afghan diplomats, health workers and agricultural engineers, the first time China has ever co-operated with a third party in another country. Ambassador James Dobbins, Obama's special representative for Afghanistan, now has thrice-yearly meetings with his Chinese counterpart to discuss future areas of co-operation.

Barnett Rubin, who recently stepped down as adviser to Obama's special representative for Afghanistan and Pakistan, told the Jaipur Literature Festival that China and America "have a growing convergence of interests in the areas to the west of China. Taliban militants attacking Chinese mining activities in Logar province are coming from Pakistan. Uighur militants in western China are being trained in Pakistan, and are going back to China. China has found that Pakistan is not effectively stopping those people. This has really affected China's attitude to Pakistan, which it no longer considers a reliable ally. This is one of the reasons why Chinese-Indian relations have started to warm, and that China is seeking co-operation with the US in Afghanistan."

While China is pressing its old ally Pakistan to do more to contain militant groups, it is also mending fences with India, an old rival. It has pulled back its troops from disputed border areas in the Himalayas and is entering into talks with India on security co-operation in Afghanistan. Last month China became India's biggest trading partner. The China-Pakistan alliance, for 50 years the crucial relationship between south and east Asia, is now looking increasinglypast its sell-by date.

Much of what happens next will be determined by events in Afghanistan. Elections will be held, Karzai will step down, and Nato and the US will both withdraw. Sadly, the stability and integrity of Afghanistan during that process is something that even the growing power of China cannot guarantee.