The United Nations security council has voted unanimously to punish North Korea for last month's nuclear test with a toughened sanctions regime, hours after Pyongyang threatened to unleash a pre-emptive nuclear strike on the United States.

Secretary general Ban Ki-moon, a former South Korean foreign minister, said the resolution "sent an unequivocal message to [the North] that the international community will not tolerate its pursuit of nuclear weapons".

The decision by the 15-member council followed lengthy negotiations between the United States and China, the North's main ally. Measures range from tightened financial restrictions to cargo inspections and an explicit ban on exports of yachts and racing cars to the North, but experts say the real issue is enforcement.

North Korea immediately rounded on the UN with more threats, saying it would cancel a non-aggression pact with the South and end other bilateral measures such as a hotline between Pyongyang and Seoul.

China's UN ambassador Li Baodong said Beijing, Pyongyang's main trading partner, wanted to see "full implementation" of the resolution.

Susan Rice, the US ambassador to the UN, told reporters that the measures would "bite hard". She added: "North Korea will achieve nothing by continued threats and provocations."

A foreign ministry spokesman in Pyongyang had threatened to launch "pre-emptive nuclear strikes on the headquarters of the aggressors" because Washington was pushing to start a nuclear war against it, in a statement hours before the UN vote.

Experts do not believe the North has managed to produce a warhead small enough to be mounted on a missile that could reach the US. They also pointed out that the original Korean language version referred to "invaders" rather than merely the "aggressors" of the English translation.

Jennifer Lind, associate professor of government at Dartmouth College in New Hampshire, said that while the statement was disturbing, "North Korea has a long history of bluster and issuing threats that of course it does not carry out, [such as] its long term threats of turning Seoul into a sea of fire."

Earlier this week the North threatened to cancel the 1953 armistice that ended the Korean War.

Thursday's resolution condemns the North's third nuclear test "in the strongest possible terms" as a flagrant breach of previous resolutions, which bar it from testing or using nuclear or ballistic missile technology and importing or exporting material for the programmes.

It aims to hinder those programmes but also targets the ruling elite. A ban on luxury exports was introduced in 2006, but countries could decide what fell under that rubric; this time, specific items are identified.

The resolution warns the North against further provocations and demands its return to the Nuclear Nonproliferation Treaty. But it also stresses the council's commitment "to a peaceful, diplomatic and political solution" and urges a resumption of six-party talks.

All countries are required to freeze financial transactions or services that could contribute to the North's nuclear or missile programmes. Public financial support for trade deals that could assist the programmes is outlawed.

Countries must expel agents working for blacklisted companies from the North. They must inspect aircraft or vessels with suspect cargo and deny entry to those that refuse inspection.

Hazel Smith, an expert on the North at Cranfield University, said the key question was how rigorously the US implemented financial sanctions, citing tough measures taken by Washington towards the end of the Bush administration.

"They did have a major effect; they also paralysed diplomacy. But there is no diplomacy happening now," she said.

Analysts suggest the immediate reaction of the North is likely to be further angry rhetoric and possibly another nuclear test, as Pyongyang hinted earlier. South Korean government sources cited by Seoul news agency Yonhap said on Wednesday that the North had imposed no-fly and no-sail zones off its coasts, apparently preparing for military drills.

"North Korea will throw their usual histrionics about the resolution," said Andrei Lankov of Kookmin University in Seoul in an interview prior to the latest threat.

"Every time there's an escalation the risk of confrontation increases. But neither side wants anything to happen."

At a Senate foreign relations committee hearing on North Korea, chairman Robert Menendez described the nuclear strike threat as "absurd and suicidal".

Menendez, a Democrat, was holding the hearing as the UN security council voted for the resolution. He welcomed the new sanctions but said the US needed to do more to combine sanctions and military countermeasures with strong and realistic diplomacy aimed at North Korea and China.

"There should be no doubt about our determination, willingness, and capability to neutralise and counter any threat that North Korea may present," Menendez said. "I do not think the regime in Pyongyang wants to commit suicide, but that, as they must surely know, would be the result of any attack on the United States."

Glyn Davies, the State Department's special representative on North Korea, warned of "costly consequences" for the country.

Its 12 February nuclear test, he said, represented "an even bolder threat to US national security, the stability of the region and the global non-proliferation regime".

Davies told the committee the Pentagon was working with its counterparts in Japan and South Korea to ensure protection against an attack.

The US would continue to look at unilateral sanctions against banks and other North Korean-linked bodies and seek to harmonise existing sanctions with other countries, he added.

The US will not engage in negotiations unless there is a fundamental change in attitudes in North Korea. "The DPRK leadership must choose between provocation or peace, isolation or integration," Davies said.