North Korea's threat to launch a pre-emptive nuclear strike on the US need not be taken seriously – yet. But it has the bomb (in fact 12, by reliable estimate) and ballistic missiles, and it will take only a few years to design a nuclear warhead and a re-entry heat shield for the drop on Hollywood. By then Iran may have the bomb, as well as Saudi Arabia, and perhaps even Egypt. We will, by that time, feel nostalgic for the good old days of the cold war. So what do we do, other than wait for when the American president decides to carpet-bomb Pyongyang?

North Korea's threats have served to expose the fatal flaw in the nuclear non-proliferation treaty. This was negotiated after the Cuban missile crisis with the object of limiting nuclear weapons to five great, or at least sensible, superpowers which would, one fine day, agree on reducing their arsenals to zero.

North Korea reluctantly joined the NPT in 1985, but withdrew again in 2003. The UN security council should never have allowed this – the treaty does not permit withdrawal unless membership jeopardises a party's "supreme interests". North Korea just wanted to build bombs without interference by the International Atomic Energy Agency. It did so, testing its first bomb on American Independence Day, 4 July, in 2006.

Back in 1994, when it was discovered that North Korea had furtively amassed enough plutonium for two bombs, Bill Clinton's administration seriously considered invasion but was horrified at the estimated cost: $100bn and a million casualties. War was averted by the diplomacy of Jimmy Carter, who negotiated an "agreed framework", which soon collapsed and was later replaced by "six-party talks", which have stuttered on for the past 10 years. Meanwhile the military has kept processing uranium and testing missiles.

More sanctions will not deter North Korea from proceeding towards delivering upon its threats. It has suffered increased sanctions after every provocative act, and even China now votes for them in the security council. US bombing of its cities or its nuclear facilities, even with China's acquiescence, would result in bloody reprisal attacks.

There are two ways the security council can proceed. One is emollient: give North Korea what, behind all the bluster, it really wants, namely readmission to the NPT as the sixth (or seventh, behind India) nuclear weapon power. That has already been rejected by John Kerry, and would be resisted by other states. It may, however, be the only way, short of military force, to restrain this impossible state. Readmission to the NPT with that status would at least impose on it an eventual duty to disarm (albeit a duty on which, without invasive IAEA inspections, it might cheat).

The other option is to treat North Korea's threat of nuclear war as a crime against humanity, and to refer its behaviour to the international criminal court prosecutor for investigation and potential indictment of Kim Jong-un and his generals.

Using or threatening to use nuclear weapons was declared a crime against humanity by the UN in 1984, while in 1996 the international court of justice ruled that "the threat or use of nuclear weapons would generally be contrary to the rules of (international) law", other than in "extreme circumstances of self-defence", which do not apply to North Korea's current threats of first use.

Dropping or threatening to drop a nuclear weapon is illegal because fallout does not discriminate between military targets and civilians, because the consequences are beyond human control, because the suffering it causes is immense and unnecessary. As the ICJ has said: "The destructive power of nuclear weapons cannot be contained in either space or time." It breaches the two most fundamental human rights, the right not to have life taken arbitrarily and the right not to be subjected to torture, in this case, by ionising radiation.

The international criminal court at The Hague has for the past decade been cutting its teeth on issues of no great legal pith – atrocities, certainly, but essentially murders and incitements to murder. It has hardly begun to fulfil its purpose, because its indictments have been confined to local African politicians and warlords. An international court should be dealing with international criminals. Those who unlawfully make, manufacture or threaten to use nuclear weapons are the most dangerous international criminals of all.