The fall of Afghanistan to the Taliban and the ensuing chaos present a “complicated situation” for China, a Cornell professor told CNBC.

“At one level, what is happening in Afghanistan might be considered a win for China because it suggests that the U.S. has a lot of weaknesses in terms of its intelligence … the way it deploys its massive military arsenal and economic power, sometimes to not very productive ends,” Eswar Prasad, a professor of trade policy at Cornell University in New York told CNBC “Street Signs Asia” on Tuesday.

America’s “long and unproductive involvement” in Afghanistan has been a “black eye” for U.S. foreign policy, said Prasad, who was formerly head of the International Monetary Fund’s China division.

“This will certainly knock the U.S. down a peg or two in the eyes of the rest of the world, although it is far from clear that the outcome in Afghanistan will by itself … drive any country deeper into China’s economic and political embrace,” he said in a separate email.

Afghanistan fell to Taliban control when the Islamist militant group seized the capital of Kabul more than a week ago. The Taliban have made rapid advances across the country since the U.S. started withdrawing its military forces in Afghanistan ahead of its Aug. 31 deadline.

I think Beijing is likely to gloat in the short run — but who knows, it could have some problems on its hands in the long run.

Eswar Prasad

professor of trade policy, Cornell University

Concern in Beijing over resurgent Taliban

A Taliban takeover could also come with its own problems for China, Prasad said.

There’s legitimate concern in Beijing about what a resurgence of the Taliban and other extremist groups might mean for China’s domestic stability as “it’s hard to imagine this won’t spill over the border in some fashion or the other,” he said.

Read more on the developments in Afghanistan:

‘Void’ left by U.S. withdrawal

The hasty U.S. withdrawal from Afghanistan also raises some questions, Cornell’s Prasad pointed out.

“There are questions about whether — even if the U.S. is committed in the short run to a particular country or a particular region — whether the commitment can be sustained, or is credible over the longer term, and also whether the commitment might end in a very messy fashion, as we’re seeing right now,” he said.

Meanwhile, there are questions about who will fill the vacuum left by the “weak” American commitment in the region, Prasad said.

“The question is whether there is an alternative power that can, again, fill in the void that might be created by perceptions of weak American commitments or weak American ability to deliver on those commitments.”

 — CNBC’s Abigail Ng and Natasha Turak contributed to this report.