As US and Israeli officials weigh up prospect of military strike on Iran, critics say any attack would go against international law

Amid the sabre-rattling and bluster over Iran, a furious if little-noticed debate is boiling over the legal basis for a US or Israeli attack on Tehran's nuclear programme.

The threat of a military strike hangs over this weekend's talks in Istanbul between the major powers and Iran.

The Israeli leadership says an attack will come within months, not years, if the present diplomatic push fails. The US Congress is not far behind, with the Republican leadership pledging to pass an authorisation for the use of "overwhelming military force" if there are signs Iran is developing a nuclear weapon.

Barack Obama is more cautious, but says the "military option" remains on the table if sanctions fail to persuade Tehran to give up its enriched uranium.

But while intelligence agencies grapple to assess whether Tehran is attempting to develop a nuclear weapon and militaries on both sides of the Atlantic consider the logistics of bombing Iran, legal authorities are confronting the challenge of constructing a legal case for attack, if it comes.

And already there is considerable dispute over the issue.

Alan Dershowitz, the renowned jurist and supporter of Israel, has argued that the US and the Jewish state can invoke a long-standing right under customary international law of "pro-active self-defence" as well as article 51 of the United Nations charter.

Sceptics counter that international law only permits military action in response to an imminent attack, or if one is under way. They say there is no immediate threat because, as the White House has said, there is no evidence Tehran is building a nuclear weapon.

Then there are those who argue that the legal grounds for a military assault have already been met because the US and Israel are already under attack from "terrorist organisations" sponsored by Iran.

There is considerable support among politicians who favour an attack on Iran for the view of Anthony D'Amato, a professor in international law at Northwestern University, who has argued cases before the European Court of Human Rights. He says using force to prevent Iran obtaining a nuclear weapon would uphold international law, not undermine it.

"Iran says it wants to push the Israelis into the sea and that they are constructing nuclear weapons. That's enough for me to say that cannot be allowed. If the US or Israel takes the initiative to block that action, it can hardly be said to be violating international law. It can only be preserving international law for future generations," he said.

"In order to preserve international law we have to defend it once in while. I think we have to defend it against rogue states or states that have expressed a hostile intentions, like Iran and like North Korea. The only reasonable thing to do is to take those weapons out. Remove that threat and the world is going to be safer."

But D'Amato's view is scorned by other specialists in international law.

Much of the the legal argument centres on the interpretation of one word: imminent.

Although the United Nations charter recognises the right of self-defence, it is imprecise. Lawyers look beyond the charter to an older standard in customary international law, established in the 19th century, allowing one state to use force to preempt an imminent attack by another.

That came out of a cross-border raid by British forces into New York state in 1837 to destroy an American ship, the SS Caroline, which was delivering aid to a rebellion in Canada. The British raiding party set fire to the Caroline and cast her adrift toward Niagara Falls. One American was killed.

In the ensuing diplomatic battle, London and Washington agreed on a treaty providing for a right of pre-emptive self-defence – more commonly spoken of today as a pre-emptive strike – but only when there is "instant, overwhelming" necessity, "leaving no choice of means, and no moment of deliberation".

That formula has long been regarded as an integral part of international law, but there are wide differences over how the "Caroline test" would apply to a US or Israeli attack on Iran.

D'Amato said the threat is imminent because of Tehran's rhetoric against Israel. He said the US and Israel are also entitled to act under a clause in the UN charter – article 2, paragraph 4 – requiring countries to refrain from "the threat or use of force against the territorial integrity or political independence of any state".

"Let's ask the question: who would be violating that clause? Would it be the United States' attack on Iran or would it be Iran's threat against Israel? Who is the violator here? If Iran is in a war to the death with Israel, as they claim they are, and they are also preparing nuclear weapons against a small state, I think any reasonable person would look at that and say they are in violation of article 2 section 4 of the charter," he said.

But Kevin Heller, author of The Nuremberg Military Tribunals and the Origins of International Criminal Law, and who served as Human Rights Watch's external legal advisor on Saddam Hussein's trial, is dismissive of D'Amato's interpretation.

"To say that argument is profoundly flawed is an understatement. It may well be that by threatening the use of force Iran is in breach of the UN charter. But that couldn't possibly justify a military response," he said.

Heller said that whatever threat Iran my pose, it is not "imminent", as required by the Caroline test.

"In terms of Iran, I don't even think it's enough under the UN charter for the US to say Iran has a nuclear weapon. At a minimum, they would actually have to have a nuclear weapon, and they would have to issue some kind of concrete threat to use it against Israel or some other country before a military response would be acceptable," he said.

Bruce Ackerman, an influential constitutional law professor at Yale, is similarly sceptical of any claim of an imminent threat.

"The idea that the United States is under imminent threat from Iran is preposterous. It is not preposterous that Israel's under threat from Iran. It just isn't imminent," he said.

Ackerman said interpretations of the UN charter have evolved to permit the use of force in situations such as a "duty to protect" where there are large scale abuses of human rights.

"Those arguments were begun most obviously in the Kosovo matter and continued with Libya, although in the Libyan case there was an express United Nations security council authorisation. It also arises in Syria right now. But Iran is not that kind of case," he said.

"Similarly, this is not a case having to do with the war on terror. It's a case in which one sovereign feels threatened by another sovereign. It's just the kind of thing that has been happening for a very long time and it was precisely this kind of anticipatory anxiety generating wars that the League of Nations and then the United Nations was intended to respond to."

Critics of the argument that the US and Israel have the right to pre-empt Iran's attempts to build a nuclear weapon – something it says it is not doing – point to Washington's reaction to the Israeli attack on Iraq's nuclear reactor at Osirak 31 years ago.

That was condemned not only by the rightwing Reagan administration but by Margaret Thatcher, and drew a unanimous condemnation in the UN security council.

But the politics has evolved since then. When Israel attacked a Syrian nuclear facility five years ago, it did not draw a whisper of criticism in Washington or London.

John Brennan, the White House counter-terrorism chief, has argued for a more flexible interpretation of "imminence" in the context of pre-emptive strikes because of the threat from terrorism. Supporters of an attack on Iran say that any reinterpretation could equally apply to "rogue states" or those that sponsor terrorism.

Others have proposed that the US and Israel justify an assault as self-defence because Iran has already attacked both countries through Tehran-backed groups such as Hezbollah. Dershowitz has said that Israel can already justify an attack on those grounds and that the US could likely construct a similar case.

"If Israel were compelled to act alone against Iran's nuclear programme, it too would be reacting as well as pre-empting, since Iran has effectively declared war against the Jewish state and its people," he wrote in the Wall Street Journal.

Heller is sceptical. "Iran doesn't have the kind of overall and effective control over Hamas and Hezbollah that would make their actions imputable to Iran, justifying self-defence," he said. "But even if they did, just because there may be an armed attack on Israel by Hamas doesn't mean you can take out a country's nuclear programme. There has to be some kind of necessity and proportionality between the armed attack and the response."

The legal niceties are unlikely to stop the US or Israel if they are determined to attack Iran. The Bush and Obama administrations both shopped around within their own legal departments until they got the advice they wanted to hear on issues from invading Iraq to the growing government surveillance of ordinary Americans.

But Ackerman notes that riding roughshod over international law carries dangers. For a start, Iran could make a reasonable case that it is the one under threat, with all of the bellicose rhetoric out of Washington and Jerusalem – and therefore it has a right of pre-emptive self-defence.

"Where does this kind of radically expanded notion of pre-emptive attack stop?" asked Ackerman. "What's going to happen when China feels threatened by Taiwan, or India by Pakistan, or vice versa? We would be setting a precedent here which be a very serious blow to the rule of international law."