Analysts say North Korea's claims of a nuclear test are pushing Beijing to reassess its relationship with Pyongyang. At the same time, observers say the events of the past few days have highlighted a growing relationship with former rival South Korea.
An 85-year-old man who calls himself Wang sits in a Beijing park, watching a game of ping-pong.
Like millions of Chinese his age, Wang says he was drafted more than a half century ago to support the effort to defend North Korea against U.S.-led forces in South Korea. China may have lost a million soldiers in that war.
For Wang, like many other people in China, the feeling of solidarity with a socialist neighbor is now a distant memory.
He says the matter of defending North Korea is long forgotten.
Instead, China has turned its attention to South Korea. The two established diplomatic relations in 1992 and since then trade between Beijing and Seoul has skyrocketed, and could top $200 billion in six years.
With China working to build its economy, political analysts say, it has made more sense to concentrate on ties with Seoul, instead of Pyongyang, where the relationship has been largely static - based on historic and sentimental reasons.
Beijing has long propped up the faltering North Korean economy, and is the country's main supplier of fuel and food.
Beijing's relations with Pyongyang have spiraled downward, as shown this week in China's unusually stern condemnation of North Korea's announcement that it had tested a nuclear device.
However, analysts say China cannot afford to write North Korea off yet, and they say that is why Beijing is hesitant to support tough sanctions or push for regime change in Pyongyang.
David Kang, a professor of government at Dartmouth College in the United States who has written extensively about China's relations with the two Koreas, says Beijing's ties with both countries remain important.
"They are important in different ways. South Korea is more important for its long-term goals. North Korea is important because of the threat it poses," he said.
China fears a collapse of the North Korean regime would send a flood of refugees into its territory.
Analyst Ralph Cossa, the head of the Pacific Forum of the Center for Strategic and International Studies in Honolulu, says the Chinese leadership is playing a balancing act.
"The Chinese understand that the South Koreans are the winners," he said. "When unification finally comes about, it's going to be under the political, economic, and social system that prevails in Seoul. So the Chinese, if they want to have future influence on the Korean peninsula, they need to keep North Korea propped up, while continuing to court Seoul."
People on the streets of Beijing expressed distress this week over North Korea's nuclear test claims.
Wang recalls the Korean War and says he would not want his grandson fighting to defend North Korea now, recalling the experience of his own generation.
He says the government just wanted people to think it was important to do whatever we could to save the country.
Now, many Chinese are questioning what good China might achieve by continuing to back North Korea.