Just a few months ago, everything seemed under control. President Obama took to the Rose Garden in April with Japanese Prime Minister Shinzo Abe at his side. Ostensibly, Obama’s purpose was to reaffirm America’s close ties with Japan. But, inevitably, Obama’s remarks turned to the elephant in the room: “We welcome China’s peaceful rise,” Obama said.The president warned against Beijing’s stubborn buildup of artificial islands in the South China Sea. But that was just one facet of China’s increasingly aggressive posture toward the U.S. That same month, it turned out, the Office of Personnel Management first detected China’s unprecedented hack into its database: a haul granting access to the personal details of over 20 million Americans in and out of sensitive government positions.

Since then, we’ve seen China flounder amidst a massive stock market crisis. And therein lies a big problem. It’s not a militarily strong and economically healthy China we should be worried about. It’s an armed-to-the-teeth and economically sputtering China that’s a real threat to the West. (China did just declare that its GDP grew 7 percent last quarter, butthis claim simply cannot be believed.)

In his Rose Garden remarks, Obama made plain why the U.S. was counting on China’s economy to maintain such breakneck growth. “We think it’s good not only because it allows China potentially to share some burdens with us in helping countries that are not as far along,” he said. But it’s also “just good that hundreds of millions of Chinese citizens have been able to rise out of poverty at incredible speed over the last several years. They could not have done that had it not been for a stable trading system and world order that is underwritten in large part by the work that our alliances do.”

In Obama’s squishy framing, that sounds like big-hearted do-gooderism. But there’s a more blunt truth beneath it: Without a healthy economy, China can’t generate the wealth required to stave off serious domestic instability. And America and the West are counting on a stable China. An unstable, economically stumbling China is one that may lash out abroad, acting unpredictably and dangerously to make up for any perceived diminishment to its global stature.

Or think of it this way: Gearing up for international belligerence is a pretty good insurance policy against civil unrest in bad economic times. Just ask North Korea.

China has an immense surplus of young single men. If the economy goes sour, where do you think they’ll go looking for work? The one place where China’s boom is sure to continue: The military.

The one-child policy has not only created a generational imbalance. It has primed China for the kind of restive military that becomes an international threat in lean and troubled times. In a depression economy — or even a recession economy — China’s youthful male singletons face a grim and hopeless future. But in a depression or recession military, security, advancement, and even triumph suddenly come to the fore.

It may soon be time to kiss China’s peaceful rise goodbye. That would be bad enough if the Middle Kingdom were an autarkic, self-enclosed regime like North Korea. Instead, China has never been more globalized. It’s joined to the U.S. at the economic hip. What happens if China’s economy does not recover? It’s frightening to consider.