From the rhetoric of President Bush to his dispatch of Patriot air-defense systems and a second carrier battle group to the Persian Gulf, there are growing signs that the Bush administration is showing its willingness to solve the Iranian nuclear crisis with a preemptive military attack. The already tense US-Iran relationship is now a tinderbox.

Secretary of Defense Robert Gates was correct in stating recently that Iran is "acting in a very negative way" in the Middle East. The Islamic Republic trains and supports Hizbullah and Hamas. It provides aid and explosives to Iraqi Shiite militias who attack American soldiers. Most alarming, it seems determined to develop a nuclear bomb. This panics moderate Arab states and poses an existential threat to Israel. The ruling mullahs in Tehran terrorize their own citizens, especially pro-democracy groups.

Bombing Iran, however, will not resolve any of these dangers – it would exacerbate them. But where military strikes would fail, containment and comprehensive negotiations would succeed.

Contrary to conventional accounts, President Mahmoud Ahmadinejad is neither the most powerful official in Iran nor is he loved by the Iranian people. The authoritarian regime is not united behind Mr. Ahmadinejad and his policies, but divided and uncertain about who will prevail. The real kingpin in Iran is Supreme Leader Ayatollah Khamenei, and his failing health has launched a succession struggle. On one side of this fight are Ahmadinejad, a cabal of leaders from the Revolutionary Guards, and the Basij (the militia-cum-gangs that terrorize the regime's opponents). On the other side is a loose coalition united by their disdain for Ahmadinejad's gross economic mismanagement and reckless hubris. This includes Iran's bulging generation of young people, along with businessmen, technocrats, reformists, allies of former President Hashemi Rafsanjani, and even the conservative Motalefe Party.

After a year of rising stardom, Ahmadinejad is starting to lose in this power struggle. He has not delivered on his campaign pledges to fight corruption or improve the lot of the working classes and the poor. In recent elections for local councils as well as for the powerful 80-man Council of Experts (entrusted with the task of choosing the next spiritual leader) Ahmadinejad and his allies suffered humiliating defeats.

To reverse his waning popular support, Ahmadinejad has tried to change the subject from his domestic failures to his foreign adventures. He knows there is only one thing that could bring the people back to him – a US military attack on Iran. His repulsive remarks about Israel and his nuclear bravado aim precisely to provoke such an attack, which would create the crisis conditions necessary for his faction to seize full power.

Just as Iran's reactionaries are pining for war, some of Iran's more moderate leaders have written a letter asking the Saudi government to help reduce tensions between the US and Iran. Military confrontation with US forces would silence this camp domestically.

In fact, Iran's democratic opposition warns that a US military strike would strengthen the regime hard-liners and weaken their own already limited ability to operate. If Ahmadinejad welcomes war with America and Iran's dissidents fear it, shouldn't the Bush administration think twice about the unintended consequences of military action?

If Ahmadinejad does consolidate power, Iran would act in an even more negative way. Moreover, it would do so with soaring support throughout much of the Muslim world, for an American attack would elevate him to hero status.

This would only fan his faction's ambitions to establish Iranian hegemony in the Middle East. Its support for terrorist organizations would increase. Terrorism, polarization, and sectarian violence would intensify in Iraq, Lebanon, the Palestinian territories, and Afghanistan, and could begin to engulf Bahrain and even the Shiite region of Saudi Arabia – where most of the country's oil is.

A sustained US bombing campaign would disrupt Iran's nuclear weapons programs. But the newly consolidated hard-line regime in Tehran would be even more emboldened to acquire nuclear weapons. A preemptive attack, which would lack international legitimacy, would also prompt Iran to withdraw entirely from the nuclear nonproliferation regime, as some of Ahmadinejad's allies have already threatened, while inducing the crucial international fence-sitters – Russia and China – to back Iran without hesitation.

There is an alternative. Rather than throw the reactionaries in Tehran a political lifeline in the form of war, the United States should pursue a more subtle approach: Contain Iranian agents in the region, but offer to negotiate unconditionally with Iran on all the outstanding issues. Comprehensive negotiations could offer the powerful inducements – such as a lifting of the economic embargo and a significant influx of foreign investment and thus jobs – necessary to persuade Iran to halt nuclear enrichment. And if the hard-liners reject the offer, they would have to contend with an angry Iranian public. Such internal strife would be far preferable to an Islamic Republic united against the attacking forces of the "Great Satan."

• Abbas Milani, Larry Diamond, and Michael McFaul are research fellows at the Hoover Institution. They also teach at Stanford University.