The invasion of Iraq in 2003 was a tragedy - for Iraq, for the US, for the UN, for truth and human dignity. I can only see one gain: the end of Saddam Hussein, a murderous tyrant. Had the war not finished him he would, in all likelihood, have become another Gadafy or Castro; an oppressor of his own people but no longer a threat to the world. Iraq was on its knees after a decade of sanctions.

The elimination of weapons of mass destruction was the declared main aim of the war. It is improbable that the governments of the alliance could have sold the war to their parliaments on any other grounds. That they believed in the weapons' existence in the autumn of 2002 is understandable. Why had the Iraqis stopped UN inspectors during the 90s if they had nothing to hide? Responsibility for the war must rest, though, on what those launching it knew by March 2003.

By then, Unmovic inspectors had carried out some 700 inspections at 500 sites without finding prohibited weapons. The contract that George Bush held up before Congress to show that Iraq was purchasing uranium oxide was proved to be a forgery. The allied powers were on thin ice, but they preferred to replace question marks with exclamation marks.

They could not succeed in eliminating WMDs because they did not exist. Nor could they succeed in the declared aim to eliminate al-Qaida operators, because they were not in Iraq. They came later, attracted by the occupants. A third declared aim was to bring democracy to Iraq, hopefully becoming an example for the region. Let us hope for the future; but five years of occupation has clearly brought more anarchy than democracy.

Increased safety for Israel might have been an undeclared US aim. If so, it is hard to see that anything was gained by a war which has strengthened Iran.

There are other troubling legacies of the Iraq war. It is a setback in the world's efforts to develop legal restraints on the use of armed force between states. In 1945 the US helped to write into the UN charter a prohibition of the use of armed force against states. Exceptions were made only for self-defence against armed attacks and for armed force authorised by the security council. In 2003, Iraq was not a real or imminent threat to anybody. Instead, the invasion reflects a claim made in the 2002 US national security strategy that the charter was too restrictive, and that the US was ready to use armed force to meet threats that were uncertain as to time and place - a doctrine of preventive war.

In the 2004 presidential election campaign, Bush ridiculed any idea that the US would need to ask for a "permission slip" before taking military action against a "growing threat". True, the 2003 Iraq invasion is not the only case in which armed force has been used in disregard of the charter. However, from the most powerful member of the UN it is a dangerous signal. If preventive war is accepted for one, it is accepted for all.

One fear is that the UN rules ignored in the attack on Iraq will prove similarly insignificant in the case of Iran. But it may be that the spectacular failure of ensuring disarmament by force, and of introducing democracy by occupation, will work in favour of a greater use of diplomacy and "soft power". Justified concerns about North Korea and Iran have led the US, as well as China, Russia and European states, to examine what economic and other non-military inducements they may use to ensure that these two states do not procure nuclear weapons. Washington and Moscow must begin nuclear disarmament. So long as these nuclear states maintain that these weapons are indispensable to their security, it is not surprising that others may think they are useful. What, really, is the alternative: invasion and occupation, as in Iraq?

· Hans Blix was head of UN inspections in Iraq in 2003 secretariat@wmdcommission.org