Zhou Yongkang, China’s security supremo, became the first member of the country’s top leadership to visit Kabul since the 1960s recently, jetting in for several hours for talks with President Hamid Karzai.

Perhaps Zhou, China’s crackdown connoisseur, had some advice for Karzai about how to properly squash one’s opponents (on Afghanistan’s reconciliation process, he may have had less to contribute). In any case, his trip underlined that from Beijing’s perspective Afghanistan represents both a risk and an opportunity. And whichever side of the coin you choose to emphasize, the situation demands the same policy choice: greater Chinese involvement in Afghanistan.

Though China is hardly interested in cleaning up NATO’s mess, it can ill afford to do nothing as Afghanistan stumbles into its post-American future. A failed state on China’s borders would be serious enough; one controlled by Islamist extremists who might offer support to insurgents in Xinjiang would be even worse.

Nor is Afghanistan a place that a resource-hungry nation like China would want to ignore, even if it could. The $1 trillion value placed on Afghanistan’s natural resources makes the country a prize as yet unclaimed, for the most part, by multinational oil and mining corporations. The China National Petroleum Corporation (CNPC) took a first slice of the pie late last year, with the China Mellurgical Construction Co. having already committed $3.5bn to Afghanistan’s Aynak copper mine – the biggest investment anyone has yet dared to make in an Afghan business venture. Nonetheless, these are probably just first steps for China Inc.

Zhou was reported to have signed “security and economic cooperation agreements” with Karzai: really, that means, “we’ll keep you secure, if you cooperate economically”. Karzai may well need China’s help if he is to remain in power, and keep the Taliban away from the gates of Kabul. Initially, that means money; later it could mean more direct security involvement on China’s part. However Karzai views China’s future role in Afghanistan, he is undoubtedly a man who fears for his own future. That will surely give China plenty of leverage when the haggling starts (which, in light of Zhou’s trip, it probably has).

The big question is whether China can squeeze Afghanistan into its template for dealing with less-developed, and potentially awkward neighbors. The opportunities are as great, if not greater, than in Cambodia, or Laos, or Burma; but the barriers to success are more daunting – this is one country where a pliant government will not be enough to ensure that China’s economic dealings are profitable.

Afghanistan arguably represents the greatest test of Chinese soft power to date. With none of the wartime baggage that so many other countries are carrying with them as they head for Afghanistan’s exits, the Chinese can enter with the promise of rapid development such that only China can deliver. That’s a message that plenty of Afghans will want to hear, and one that may be powerful enough to drown out even the Taliban’s threatening counterblasts.

Afghanistan will therefore prove a tempting challenge for an increasingly confident China. Beijing will certainly be happy to succeed where both the Soviet Union and the United States have both failed.

Trefor Moss is an independent journalist based in Hong Kong and Flashpoints blogger. He covers Asian politics, defence and security, and was Asia-Pacific Editor at Jane’s Defence Weekly until 2009. He can be followed on Twitter @Trefor.