The United Nations security council has punished North Korea over last month's underground nuclear test by imposing new sanctions, risking potential flashpoints at sea as it called on all members of the international community to stop and search its ships for weapons.

The resolution, which unusually was unanimous, bans all weapons exports from North Korea and the import of all but small arms. Securing a unanimous resolution shows the extent of the anger within the Chinese government over last month's nuclear test. Normally it is difficult for the US, Britain and France, all members of the security council, to persuade China and, to a lesser extent, Russia to take a tough line against North Korea.

The US ambassador to the UN, Susan Rice, described the resolution as "unprecedented". She said that the sanctions regime has "teeth that will bite".

China strongly urged Pyongyang to promote denuclearisation of the Korean peninsula. China's envoy, Zhang Yesui, said it showed the "firm opposition" of the international community to North Korea's nuclear weapons ambitions.

While China and Russia are concerned about North Korea's nuclear armoury, they do not want to do anything that would precipitate the fall of the Pyongyang government and lead to the reunification of the peninsula.

Pyongyang's reaction is difficult to predict. The regime could retaliate by conducting more tests of nuclear weapons or of long-range missiles, or, given its tendency for sudden switches in tactics, it could even return to the negotiating table.

The most controversial part of the resolution is the stop and search powers. The US, Britain and France wanted to make it mandatory for all states to search North Korean ships but China and Russia had this watered down. The resolution only "calls" on states to carry out such inspections to ensure North Korea is complying with the weapons ban. But it is a potentially dangerous move that could lead to standoffs between US and North Korean ships.

There was no attempt to expand the sanctions to exports and imports of non-military goods. This is partly because China and Russia would have been opposed but also because there is a fear that a collapse of the North Korean economy would result in a flood of refugees into South Korea.

North Korea entered into international negotiations during the Bush administration aimed at abandoning its nuclear programme after being threatened with sanctions three years ago. But the process, which has been fitful for 15 years, subsequently collapsed. The Obama administration's main aim is to get North Korea back to the negotiating table.