Image caption The four were allegedly shot close to the countries' border

China says a North Korean border guard shot and killed three people near the countries' border last week.

A fourth person was reportedly injured in the incident near the north-eastern border town of Dandong.

China has made a formal complaint to North Korea, a spokesman for the Chinese foreign ministry said.

The two countries are considered to be close allies and Beijing rarely makes any public criticism of its isolated neighbour.

Foreign Ministry spokesman Qin Gang told a regular news conference in Beijing that the four residents of Dandong, in Liaoning province, had been shot "on suspicion of crossing the border for trade activities".

"China attaches great importance to that and has immediately raised a solemn representation with the DPRK," he said, using North Korea's full name (Democratic People's Republic of Korea).

Close ally

Mr Qin said the case was being investigated, but gave no further details. Pyongyang has not commented on the accusations.

Illegal traders regularly cross the border between North Korea and China, taking black market goods into the impoverished country.

China is North Korea's main trading partner and the country perceived to have the most influence on the state.

Tensions on the Korean peninsula have been high since the sinking of a South Korean warship in March with the loss of 46 lives.

An international investigation blamed North Korea for the sinking, but China has resisted pressure to condemn its ally. Instead, it has urged both the Koreas to show restraint.

Last month, the North Korean leader, Kim Jong-il, was reported to have visited China to seek economic and political support.

China is crucial to North Korea's fight for economic survival, providing Pyongyang with food, fuel and much-needed investment.

Beijing is also a participant in the six-party talks on North Korea's nuclear programme. The talks have been going on since 2003 without much progress.

In 2009, North Korea detained two US journalists on the border with China, accusing them of entering North Korea illegally.

Laura Ling and Euna Lee, who said they were detained on the Chinese side, were sentenced to 12 years' hard labour but were freed in August after four months in captivity, as part of a diplomatic mission spearheaded by former US President Bill Clinton.

A US man, Robert Park, was also arrested in December last year, after walking into North Korea across a frozen river. He was released in February.