Chinese leaders made a rare condolence visit to North Korea's embassy in Beijing last month.
Broadcast on China Central Television, the leaders – dressed in black suits — bowed in unison towards the portrait of Kim Jong Il. Why show so much respect to a man who had so much misery?
One reason: fear of something worse.
"China's objective is [that] there must be stability in the Korean Peninsula," says Shi Yuanhua, who runs the Center for Korean Studies at Fudan University in Shanghai. "We will do whatever it takes, or maintain stability at all cost. I think China cannot allow an Arab spring and an eastern European-style color revolution to take place in this area."
China supports the Kim family regime – now lead by Kim Jong Un – because it fears the country would collapse without it.
In the case of civil war, China worries who would control North Korea's nuclear weapons and what might happen along the 880-mile border China shares with the Stalinist state.
"If chaos occurs in this region, there may be refugee problems," Shi says. "Large number of refugees may swarm into China, which will affect the economic development of China's northeast."
Chung Jaeho, an international relations professor at Seoul National University, says China also sees its fellow communist neighbor as a useful barrier with democratic South Korea, and the approximately 28,000 American troops stationed there.
"North Korea provides a perfect place as a buffer state, and I think that sort of thinking has been there a long time in China," Chung says. "You can go back and see the books in the Ming Dynasty. They talk about the Korean Peninsula as a fence."
While China officially backs North Korea's regime, some of its citizens don't. In recent weeks, thousands of Chinese have ripped into their government on China's version of twitter.
"It is a shame that a big country like China sides with the biggest villain on earth," one online critic wrote.
A Ph.D. student surnamed Ling at Fudan University had nothing but contempt for North Korea's leaders.
"I don't support the regime. It's a dictatorship. A personality cult. An isolated country which doesn't care enough about people's lives," Ling said.
China has tried to get North Korea to adopt the sort of market reforms that have transformed the Chinese economy, but Evans Revere — a retired top U.S. diplomat who has served in Seoul and Beijing — says North Korea has been extremely slow to change.
"Kim Jong Il back in the day would visit farms and factories and industrial plants – all of which were being shown to him as examples of economic transformation," Revere says. "He and his entourage would take copious notes and say the right things to the Chinese and then they would go home and nothing much would happen."
With North Korea unable to support itself, China has become the country's benefactor. Last year, North Korea – formally known as the Democratic People's Republic of Korea, or DPRK– did about $5 billion dollars in trade.
"The lion's share of that was with the Chinese. Seventy percent was consumed by importing Chinese oil and food," says Lee Chung Min, the dean of the graduate school of international studies at South Korea's Yonsei University. "Without Chinese largesse and support, the DPRK as we know it would simply not exist."
Lee says continued support of North Korea will cost China – not just in aid, but also in prestige.
As a rising power and now the world's second-largest economy, China craves international respect, but not enough to press change on an old ally and risk instability on its own border.
Copyright 2012 National Public Radio. To see more, visit http://www.npr.org/.