BEIJING — Even though North Korea ignored China’s appeal not to test its new longer-range missile, the new leadership here appears intent on remaining a steadfast supporter of its wayward neighbor because it considers the North a necessary buffer against the United States and its allies.

Analysts said that China’s overriding fear was of a collapse of the hard-line Communist government in Pyongyang, which could lead to the reunification of the Korean Peninsula under a government in Seoul allied with the United States. China, they said, would consider an American presence on its doorstep untenable.

But China’s unyielding support of Kim Jong-un has a serious downside, they added, because it may lead to a result nearly as unpalatable: efforts by the United States and its regional allies Japan and South Korea to contain China.

“It stirs up regional security,” said Zhu Feng, a professor of international relations at Peking University who favors reducing support for North Korea. Without naming the United States, he added that the missile launching “facilitates China-bashers to work on hard-line policies to contain China, or just balance China.”