It was unclear how the shootings would affect relations between North Korea and China, which is North Korea’s closest ally in the region. China has been the host of the six-nation talks, a series of negotiations that also includes the United States, North Korea, South Korea, Russia and Japan aimed at curbing North Korea’s nuclear program. Last month, Kim Jong-il, the North Korean leader, made his first visit to China in four years, crossing the border by train and stopping in Dalian and then Beijing.

The actions of North Korean leaders have been made more opaque and unpredictable in recent months by what analysts believe is Mr. Kim’s effort to engineer a transfer of power to his third son, Kim Jong-un, 27.

China has come under pressure recently from the United States and South Korea to take a tough stand on what American and South Korean officials say was a torpedo attack on a South Korean warship in March that killed 46 sailors. China has taken a circumspect approach to the assault, to the disappointment of White House officials. China’s overriding principle on North Korea is to avoid actions that would lead to instability there, analysts say.

North Korea’s economy is in tatters, and the North Korean government relies on aid from China to help alleviate widespread food shortages. China continues to engage in trade with North Korea, and Dandong is a hub for the transfer of goods between the countries. The Yalu River forms the border there, and Chinese tourists regularly cross into North Korea from Dandong to the North Korean town of Sinuiju and beyond. North Korean refugees also cross illegally into China in that area, often with the aid of Christian groups.

North Korean border guards have been known to act unpredictably. In 2009, two American journalists were detained by North Korean guards near the Chinese town of Yanji. They were released after former President Bill Clinton traveled to North Korea.