China has delivered an ultimatum to North Korea: If they hit the United States, they're on their own.

The state-run Global Times wrote in an editorial, "China should also make clear that if North Korea launches missiles that threaten US soil first and the US retaliates, China will stay neutral."

However, should the U.S. and South Korea strike North Korea first, then "China will prevent them from" implementing regime change in North Korea.

The editorial continued:

China opposes both nuclear proliferation and war in the Korean Peninsula. It will not encourage any side to stir up military conflict, and will firmly resist any side which wants to change the status quo of the areas where China's interests are concerned. It is hoped that both Washington and Pyongyang can exercise restraint. The Korean Peninsula is where the strategic interests of all sides converge, and no side should try to be the absolute dominator of the region.

According to The Washington Post, experts believe that this Global Times editorial "probably does reflect government policy."

It's easy to see why. As columnist Noah Feldman has explained, China values "regional stability" above all else.

"It doesn't want a nuclear war in its backyard," wrote Feldman. "But it couldn't possibly benefit from the collapse of Kim's regime, which would almost certainly leave a U.S. ally, South Korea, in charge of a unified Korea across the border."

A unified Korea would of course challenge China's regional hegemony, but there's also the fact that, according to former United Nations Ambassador John Bolton, China fears "millions of refugees" flowing into the country should the Kim regime be destroyed.

Basically, China is trying to play both sides of the latest escalation between the U.S. and North Korea in an attempt to maintain their regional dominance while trying to avoid a catastrophic war breaking out near them.

But Bolton believes there is a way for the U.S. to leverage China into supporting a reunified Korea: tell them to either support it or else the U.S. will launch a pre-emptive strike, which will cause all of China's fears about the Kim regime falling to come true.

"They can work with us or face the inevitable consequences," Bolton writes.

Follow Aaron Bandler on Twitter.