China’s paramilitary police Sunday fenced in foreign embassies with barbed wire in what officials and diplomats said were attempts to keep out North Korean asylum seekers.

Security was markedly increased in the capital’s two main embassy areas with roads leading to diplomatic compounds sealed off and even some Westerners asked to show IDs before they could pass.

“It’s in order to prevent North Koreans from entering,” said a member of the People’s Armed Police standing outside a European embassy.

Foreign diplomats in Beijing confirmed the tighter security was aimed at deterring the increasing number of North Koreans who are seeking a safe haven at diplomatic representations.

There have recently been several successful attempts by North Korean refugees to enter Western embassies in Beijing and subsequently win permission to leave China for South Korea via third countries.

Late last month three North Koreans jumped the walls of the US and German embassies in Beijing and were permitted to leave China within less than 48 hours, eventually arriving in Seoul.

In March, a group of 25 North Koreans defected to South Korea after storming through the gates of the Spanish embassy in Beijing, past a lone security guard.

China appears determined to prevent embarrassing episodes like these from happening again, and security guards are now equipped with long batons.

While not all embassies in Beijing were surrounded by barbed wire by mid-afternoon Sunday, virtually all were hedged in with ordinary metal wire or plastic strips ordering outsiders not to enter.

Security was particularly tight at the South Korean embassy, and a group of six police officers was patrolling the sidewalk in front of the building.

China’s foreign ministry Sunday declined to comment on the heightened security.

Not all attempts by North Korean refugees to enter foreign embassies in Beijing have been successful.

Three North Koreans, a man and his two children, were reportedly detained last week when they tried to seek asylum in the South Korean embassy.

The Chinese attempt to make foreign embassies harder to enter comes after other efforts in recent months to prevent a flood of North Korean refugees from passing through China.

Human rights groups have said North Korean security guards, helped by Chinese police, had tracked down and arrested hundreds of refugees near the border between the two communist allies.

Beijing officially treats refugees from North Korea as economic migrants and is obliged by treaty to deport them.

But plucking North Koreans from a Western embassy to an uncertain fate at home could prompt an international outcry against China, not least from close economic partner South Korea.

This is why officials in China have concluded that the only way to deal with the problem is to stop the refugees before they get a chance to set foot on the grounds of embassies, observers said.

Aid groups say there are up to 300,000 North Koreans in China who have fled famine and repression in their impoverished country.