BEIJING — In the aftermath of North Korea's nuclear test in October, Chinese soldiers stepped up construction of a concrete and barbed-wire barrier on the banks of the Yalu River, just north of the border city of Dandong.
The move was seen as a sign of Beijing's frustration with leader Kim Jong-il's reclusive regime.
But at the same time, 150 miles farther north, the border crossing at Sanhe extended its daily opening hours from eight hours to 12.
The apparently contradictory developments throw a light on the complex and secretive nature of the relationship between China and the Democratic People's Republic of Korea (DPRK), as North Korea is officially known.
Allowing border posts to stay open longer facilitates trade. But Beijing is fearful of the potentially destabilizing effect of millions of refugees who would flood China if the Pyongyang regime collapses, so it is boosting its border defenses.
Sanhe is in an area of China known as the Yanbian Korean Autonomous Region. About half of Yanbian's 2.2 million people are ethnic Korean, and many have relatives across the border.
Yanbian is also home to most of the 300,000 North Koreans who have fled since the famine of the late 1990s.
Helped by an underground network of church groups and charities, some make their way to South Korea. But most remain in China, working illegally.
Many are women, who are more welcome because of the shortage of females in rural areas.
If caught crossing the border, North Koreans face a spell in a labor camp, torture or execution. It is much easier for Chinese citizens heading in the opposite direction.
Beijing is North Korea's biggest trading partner and provides it with 90 percent of its oil, but no longer subsidizes the exports. In return, China gets coal and even electricity. Chinese entrepreneurs are reported to be buying stakes in North Korean mines.
Many Chinese visit as tourists and travelers come back with stories of how North Korea resembles China before the reforms of the 1980s.
Desperate to prevent the collapse of the regime and fearful of having a reunified Korea backed by the U.S. on its doorstep, Beijing now quietly hopes Pyongyang will follow its example.