Imagine a moment when President Obama has only two alternatives: prepare to live with a nuclear-armed Iran or embark on the perilous path of military action to stop it.

Imagine that diplomacy has run its course; that surging international oil prices have undercut the power of economic sanctions against Tehran; and that reliable intelligence says the Islamic republic’s weapons program is very close to reaching its goal.

Facing such conditions, would Obama use force against Iran?

Former CIA chief Michael Hayden believes such a move would be necessary, recently telling CNN that a U.S. military strike against Iranian facilities “seems inexorable” because diplomacy is failing.

“We engage. They continue to move forward,” Hayden warned. “We vote for sanctions. They continue to move forward. We try to deter, to dissuade. They continue to move forward.”

As a practical matter, however, Obama’s decision on the use of force would hinge on factors well beyond Iran’s timetable for obtaining a bomb. In fact, the political, military and policy constraints Obama would face could compel his administration to forgo the military option no matter how close Iran gets to joining the nuclear club.

First, there is the United Nations to consider. Both the George W. Bush and Obama administrations have centered their responses to Iran’s nuclear ambitions on the Security Council, implying that Iran’s conduct violates not just U.S. national security interests but also Tehran’s international legal obligations.

Given this impulse to multilateralize the use of force and link it to the rule of law as well as to self-interest, the administration would have a hard time attacking Iran without Security Council backing. This particular high ground, however, might be unattainable. Indeed, the United States has obtained a series of U.N. resolutions censuring Iran not because its legal arguments and foreign policy views have wowed the world, but simply because its European partners have feared that Washington might otherwise take matters into its own hands.

Whatever progress Iran may make toward weapons of mass destruction, European diplomats and statesmen are likely to parade to Washington, concede America’s concerns, affirm its intelligence findings — and reject its policy recommendations. The United States would be advised to be patient and restock its economic sanctions kit for one more run at Tehran.

Washington would have to choose between an international coalition pledging rigorous containment of Iran, and the lonely, unpopular path of taking military action lacking allied consensus.

Domestic consensus would be critical as well. One of the tragedies of American history is that presidents have too often entangled the country in conflicts without forthright conversation with the public. Franklin Roosevelt and Lyndon Johnson engaged in their share of measured mendacity as they plunged the United States into very different wars. More recently, Bush’s decision to pre-emptively invade Iraq was characterized by exaggerated threats and faulty information.

Obama came into office pledging a new politics of accountability and responsibility, suggesting a predisposition to engage the public on the possibility that the United States may find itself in a prolonged war with a damaged but dangerous adversary.

From town halls to college campuses, the president and his advisers would need to connect with civil society, clergy and university students — not to mention Congress — on this critical issue.

The direction such a debate would take is hard to predict. According to a Gallup Poll in February, about 90 percent of Americans believe Iran poses a serious threat to U.S. vital interests; 61 percent assessed the threat as “critical.” A Fox News/Opinion Dynamics poll conducted in April found that 65 percent of Americans favor military force as a way to prevent Iran from acquiring nuclear weapons.

Yet, if skepticism about U.S. military operations in Afghanistan and Iraq is any indication, Americans are also tired of war, while doubts about the accuracy of U.S. intelligence probably remain from the run-up to the Iraq war.

The views and reactions of the Arab world would also be relevant. Although the United States is certainly capable of attacking Iran’s nuclear installations without the consent or cooperation of the United Nations or of European allies, it would be hard-pressed to do so without the help of the small countries on the Arab side of the Persian Gulf.

A campaign against Iran would require not just the acquiescence of these governments but their willingness to absorb retaliation by a bruised and outraged neighbor for years to come. While defense agreements already in place do not legally obligate the United States to come to the aid of these countries, strategic imperatives nonetheless would commit Washington to their defense. Such commitments would weigh heavily on an administration pondering the use of force.

Finally, a perceived need to warn Iran of a potential attack could complicate a decision to use force. As a nation, we have traditionally been averse to sneak attacks against even our most unsavory foes.

But warnings run counter to the military advantages of a bolt-from-the-blue attack. And while American diplomats would argue cogently that Iran’s mullahs might blink when confronted with such a dire warning, military planners would prefer surprise as a way to mitigate the dangers of an already risky and complex operation.

In the end, the balance would probably tip in favor of the moral (rather than operational) considerations, because the spiraling tension and flow of military assets to the Gulf would give Tehran all the warning it needed.

As it contemplated the use of force, the administration’s decision-making would be further complicated by the need for a plan to unwind military hostilities and make sure a confrontation did not escalate out of control.

The White House would have to signal to Tehran that the U.S. military objective was not to overthrow the clerical regime but to enforce the will of the international community by disabling Iran’s nuclear program.

The message would need to make clear that for the United States, hostilities would end with the destruction of Iran’s nuclear facilities; but that if Iran retaliated, Washington would press its attacks until Tehran could no longer respond.

There are plausible developments that could render this scenario moot. Iran has notified the International Atomic Energy Agency that it is prepared to resume negotiations after Ramadan on the transfer of nuclear fuel to third countries for enrichment. And in the face of strong sanctions, the mullahs may well blink.

But Iran would have to leave behind its peekaboo negotiating tactics and sign up for intrusive inspections and tight limits on its uranium enrichment activities. The record on this score is not encouraging, with decades of sanctions impeding but not blocking Iran’s progress to nuclear weapons capability. Thus, the world imagined here may not constitute destiny — but it will be hard to escape.