Getty Images

“THE Iranian regime is basically a messianic apocalyptic cult.” So says Israel's once and perhaps future prime minister, Binyamin Netanyahu. If he is right the world is teetering on the edge of a terrifying crisis.

While the world has been distracted by Iraq, Afghanistan and much else, Iran has been moving relentlessly closer to the point where it could build an atomic bomb. It has converted yellowcake into uranium hexafluoride gas. Now it is spinning the gas through thousands of centrifuges it has installed at the underground enrichment plant it built secretly in Natanz, south of Tehran. A common guess is that if it can run 3,000 centrifuges at high speed for a year, it will end up with enough fuel for its first bomb.

According to the International Atomic Energy Agency, the UN's nuclear watchdog, Iran could have 3,000 centrifuges hooked up by the end of this month. The Iranians say their next aim is to scale up to 54,000 centrifuges. Figuring out how to put the fuel into a usable weapon will also take time—perhaps a year or more. But for would-be bomb-builders, making the fuel is by far the hardest part. The upshot, say Israel and some American experts, is that Iran may have a bomb by the end of 2009. Mohammed ElBaradei, the IAEA's director-general, is more cautious. But even he says that if Iran really wants a bomb it could now build one within three to eight years.

Choose your unhappy ending

What Iran is doing at Natanz is entirely illegal. It has signed the Nuclear Non-Proliferation Treaty and says its nuclear aims are peaceful. But having spent decades deceiving nuclear inspectors, it is disbelieved even by its friends. A year ago this month Russia and China therefore joined the rest of the UN Security Council in ordering Iran to stop. It carried on regardless. The Security Council followed up with two resolutions, in December 2006 and March this year, repeating its demands and applying sanctions. The centrifuges spin defiantly on.

So what next? This story could have at least three unhappy endings. In one, Iran ends up with nuclear weapons, bringing new instability and a hair-trigger face-off with nuclear Israel into one of the world's least-safe neighbourhoods. In another, America or Israel take pre-emptive military action and manage to stop it, even though such an attack would almost certainly have very dangerous consequences of its own. In the third ending, Iran is attacked, and enraged, and retaliates—and still ends up with a bomb anyway.

It is vital to understand that this third finale is not a nightmare dreamt up by editorial writers. After the false intelligence that led America into Iraq, and the mayhem that followed, it may seem hard to believe that America or Israel are pondering an attack on a much bigger Muslim country. But they are—and they are not mad. This time, after all, there is no question of false intelligence: the world's fears are based on capabilities that Iran itself boasts about openly. Nor would there be another invasion: this would be an attack from the air, aimed at disabling or destroying Iran's nuclear sites. From a technical point of view, launching such an attack is well within America's capabilities (America has lately reinforced its carrier fleet in the Persian Gulf) and perhaps within Israel's, too.

Yet such an attack would nonetheless be a huge gamble. Even if it delayed or stopped Iran's nuclear programme, it would knock new holes in America's relations with the Muslim world. And if only for the sake of their domestic political survival, Iran's leaders would almost certainly hit back. Iran could fire hundreds of missiles at Israel, attack American forces in Iraq and Afghanistan, organise terrorist attacks in the West or choke off tanker traffic through the Strait of Hormuz, the world's oil windpipe. How could any Western leader in his right mind risk initiating such a sequence of events?

The succinct answer of Senator John McCain is that although attacking Iran would be bad, an Iran with nuclear weapons would be worse. He is not alone: most of America's presidential candidates would consider military force.

Cult or calculator?

If Iran really is no more than the “messianic cult” of Mr Netanyahu's imagination, it would be worth running almost any risk to stop it acquiring nuclear weapons. But as our special report argues, Iran is not that easy to read.

Iran is a self-proclaimed theocracy. Yet it has conducted foreign relations since the revolution of 1979 in a way that seems perfectly rational even if it is not pleasant. Its president, the Holocaust-questioning Mahmoud Ahmadinejad, is widely reported to have threatened to “wipe Israel off the map”. But in fact he may never have uttered those precise words, and there is both ambiguity and calculation behind the bluster. Look closer and Mr Ahmadinejad is vague about whether he means that Iran should destroy Israel or just that he hopes for Israel's disappearance. Knowing that a nuclear attack on Israel or America would result in its own prompt annihilation, Iran could probably be deterred, just as other nuclear powers have been. Didn't Nikita Khrushchev promise to “bury” the West?

Since Israel has memories of a real Holocaust, it may not set much store by that “probably”. This newspaper continues to believe that even for Israel containment of a nuclear Iran would be less awful than a risky pre-emptive attack that would probably cause mayhem, strengthen the regime and merely delay the day Iran gets a bomb. Yet the whole world still has a huge interest in preventing that day from coming. Even if Iran never used its bomb, mere possession of it might encourage it to adopt a more aggressive foreign policy than the one it is already pursuing in Iraq, Lebanon and the Palestinian territories. And once Iran went nuclear other countries in the region—such as Saudi Arabia, Egypt and perhaps Turkey—would probably feel compelled to follow suit, thereby entangling the Middle East in a cat's cradle of nuclear tripwires.

Is there a way to avoid all of the unhappy endings by finding a peaceful way to stop Iran going nuclear? The Europeans hoped they had stumbled on such a solution last year, when they at last talked Russia and China into imposing sanctions and George Bush into dangling the prospect of normal relations with Iran once enrichment stopped. But the mild sanctions imposed so far are not working, and now the technological clock in Natanz is outrunning the diplomatic clock at the United Nations. Iran may soon work out how to spin its centrifuges at full speed for long periods; and once it learns how to do that the odds of stopping it from building a bomb will rapidly lengthen. This suggests that a third sanctions resolution, with sharper teeth, needs to be enacted without delay.

Iran is obstinate, paranoid and ambitious. But it is also vulnerable. A young population with no memory of the revolution is desperate for jobs its leaders have failed to provide. Sanctions that cut off equipment for its decrepit oilfields or struck hard at the financial interests of the regime and its protectors in the Revolutionary Guards would have an immediate impact on its own assessment of the cost of its nuclear programme. That on its own is unlikely to change the regime's mind. If at the same time Iran was offered a dignified ladder to climb down—above all a credible promise of an historic reconciliation with the United States—the troubled leadership of a tired revolution might just grab it. But time is short.