BEIJING–During President Obama’s recent visit to China, he got some advice on Afghanistan from Chinese government officials – and an offer of Chinese assistance toward a negotiated settlement of the war.

Yang Wenchang, a retired senior Chinese diplomat who is currently the president of the Chinese People’s Institute of Foreign Affairs (CPIFA), told a small group of US journalists that China is willing to cooperate with the United States in finding a way out of the Afghan morass. “The two presidents discussed the issue at length,” said Yang, who maintains extensive contacts with US and other Western officials as head of CPIFA. “China will cooperate.”

However, during a wide-ranging discussion over dinner at an Italian restaurant in Beijing, the former ambassador said that China does not believe that the US and NATO can succeed militarily. “I think Obama should realize from the outset that no outside power can rule Afghanistan. The Russians tried to change the system in Afghanistan for ten years,” he said. “Many Americans, especially among the Republicans, want to send more troops. I don’t think NATO can succeed.”

Although Yang did not specify exactly how Beijing might support US diplomacy in South Asia, China’s assistance could be crucial in a political settlement of the war in Afghanistan because China is a close ally of Pakistan, and Pakistan’s support for a deal in Afghanistan is essential for the emergence of a stable, multi-ethnic government in Kabul. Though Pakistan is a nominal ally of the United States, the Pakistani military and its intelligence service, the ISI, covertly support the Taliban in Afghanistan and provide safe havens for leading Taliban officials. Over the course of a week-long visit to China, various Chinese officials and experts have said that China is concerned about the presence of US and NATO forces in Afghanistan, which has a troubled border with China, and they are concerned that growing instability in Afghanistan could lead to a spreading conflict in South Asia to the detriment of China’s interests in the region. But they are modestly encouraged, so far, by Obama’s policy.

“Obama is now considering to negotiate with the Taliban,” says Yang, who says that a political accord must allow the Taliban, especially its moderate wing, to take part in a new government in Kabul. “The United States should help build up a government in Afghanistan that is acceptable to all countries in the region,” he says. “That is the only solution.” By “all countries,” the former Chinese diplomat means above all Pakistan, which has great influence among the Taliban and among the ethnic Pashtuns who make up the majority of Afghans and from whom the Taliban draws its core support.

“Who can control the Pashtuns?” asks Yang. “Pakistan.”

Since 2001, the United States and NATO have propped up an increasingly unpopular and illegitimate Afghan government that is largely drawn from that country’s Tajik, Uzbek, and Hazara minorities, the remnants of the old Northern Alliance that opposed the Taliban during the 1990s. The Northern Alliance, in turn, was backed by India, Iran, and Russia. And Pakistan, along with the Pashtuns who live mostly in southern and eastern Afghanistan, is fearful of India’s increasing role in Afghanistan.

In a separate interview, Zheng Zeguang, the director general of the Chinese foreign ministry’s section on North America, said that China welcomes Obama’s rethinking of the war in Afghanistan. “We are quite encouraged by his new approach,” he says. “Obama seems to be taking a more comprehensive approach. The US side told us that they believe that military means is not the solution.” China, he said, is willing to step in with economic and financial assistance to Afghanistan.

More broadly, China is prepared to become involved more directly in Middle East and South Asian affairs, because it is becoming increasingly dependent on oil and gas imports from the region. Over and over again, Chinese officials told me that Beijing is intensely interested in regional stability. For the second year running, China’s oil imports have risen by double digits. “As China moves ahead on the fast track of industrialization, our demand for oil and gas is increasing rapidly,” says a top official at the Chinese Academy of International Trade and Economic Cooperation, a government thinktank. And most of that increased demand can come only from the Persian Gulf.

Recently, China has tried to assert itself in the Middle East, only to be rebuffed by the United States. Since 2001, China has tried to become a fifth member of the so-called Quartet – the US, Russia, the European Union, and the UN – that is the guiding force behind the road map for a settlement of the Israel-Palestine problem. “Unfortunately, China is not part of the Quartet,” says Zheng, of the foreign ministry’s North America section. “Personally, I do not understand why China is not included.” But a retired Chinese diplomat with wide experience in the Middle East suggests that United States is reluctant to see China play a greater role in the region. Some US analysts, such as Kenneth Pollack of the Brookings Institution, have called on the United States to bring China into the Middle East quartet, because China is likely to play a constructive role.

Zheng acknowledges that the United States must continue, at least for now, to take the leading role in the Middle East. “China,” he says, “can only play a role commensurate with its influence. The biggest factor In the Middle East is the United States.”During the Bush years, China was troubled by the US invasion of Iraq and by President Bush’s confrontational policy toward Iran, which inflamed the entire region and drove up the price of oil on world markets. Now, clearly, China hopes that the Obama administration will seek a more cooperative approach in the region that emphasizes diplomacy over military action. China is directly engaged in support of US diplomacy with Iran, though Beijing strongly opposes using pressure and the threat of new UN-imposed sanctions to force Iran to make concessions on its nuclear program. Despite China’s opposition to the war in Iraq in 2003, Beijing has taken advantage of the Iraqi government’s relative independence now to secure important Iraqi-Chinese oil deals. And, as Chinese officials make clear, China is ready to play a stepped-up role across the region, from Afghanistan to the Israel-Palestine problem.

Yet there are troubling signs. If the US talks with Iran break down, the US and China could find themselves involved in a test of wills over Washington’s desire to increase Iran’s economic isolation. And if President Obama decides soon to order a large escalation in the American war in Afghanistan, that too could lead to new tensions between Washington and Beijing.