Editor's note: Aaron David Miller is a vice president and distinguished scholar at the Woodrow Wilson International Center for Scholars and was a Middle East negotiator in Democratic and Republican administrations. Follow him on Twitter.
(CNN) -- If you want to know the prime reason President Barack Obama didn't want to bomb Syria and why the Syrian deal on chemical weapons may actually work out, however imperfectly, think one word: Iran.
Sure the limited military option against Syria was always imperfect; it would neither have ended Syria's chemical weapons capacity nor removed its president, Bashar al-Assad. There was almost no public or congressional support for a military strike either. And one of the strategic objectives of the Obama presidency was getting America out of profitless wars, not into new ones.
But motivating the president too was the challenge and opportunity of Iran. And here's why.
The grand prize and danger
Other than preventing another 9/11, there is no greater foreign policy priority for the Obama administration than stopping Iran from acquiring a nuclear weapon. That danger exceeds the risk and complexity of any other foreign policy challenge.
And the reason is simple. Unlike the Israeli-Palestinian issue or the so-called Arab Spring, Iran's quest for bomb or even a nuclear weapons capacity would upset the regional balance of power in a way no other single event could, trigger regional war, and in doing so create severe consequences for global financial and oil markets. In short, no other Middle Eastern regional event carries more serious domestic consequences for the United States, specifically threatening its economic recovery. And along with keeping America safe, that's the other great strategic objective of the Obama presidency Indeed, for a president whose main priority was -- and remains -- the well-being of the middle class, not the Middle East, Iran is a serious problem.
The notion of American credibility is thrown around these days with a kind of reckless abandon that tends to distort and trivialize its real importance. If Obama didn't push back against Israeli settlement activity, pundits said, his credibility would be undermined. If the president didn't act on his red line on the use of Syrian chemical weapons, his credibility would be damaged. And if Obama didn't strike Syria, his credibility would be shattered, the saying went.
All of these contingencies clearly eroded the president's prestige to a degree. Indeed, presidents should mean what they say and say what they mean. And they should try to ensure that the gap between their words and deeds is as small as possible.
But if the pursuit of credibility is handled without clear purpose, and with means that leaves presidential ends in worse shape, what's the purpose of the enterprise?
The pursuit of credibility can sometimes involve risk that makes the result worse than preservation of credibility itself. President Lyndon Johnson's focus on his personal credibility and the nation's in Vietnam was a classic example of courting risk and making an investment that was much too high and costly for an ill-defined notion of credibility. Striking Syria without public and congressional support and with no real strategy except for the purpose of protecting U.S. credibility just wasn't all that compelling. In fact, staying a threat and turning to diplomacy created the possibility of two breakthroughs that a strike could easily have eliminated.
The Iranian nuclear issue, however, represents a far greater threat to U.S. credibility and a far more serious need to protect it. Obama has repeatedly declared that he will not allow Iran to acquire a nuclear weapon. Two of his predecessors made the same claim. So this issue cuts to the core of whether or not in the eyes of its friends, allies and enemies, the U.S. is reliable, competent and able to act through force or diplomacy to protect its own interests.
There are indeed similarities to Syria, but the foreign policy stakes are much higher. With the exception of a failure to stop another 9/11 type attack, is there any single foreign policy challenge that could damage this president more than allowing the Iranians to cross the nuclear threshold? The fact that Israel and the pro-Israeli community figure so centrally in this issue only complicates matters.
Indeed, Israel's own readiness to act unilaterally against Iran's nuclear facilities only highlights Obama's credibility problem. If Israel struck Iran, not only would Obama be accused of forcing Israel's hand by not pursuing tough enough policies toward Iran; but if the Israelis wanted to act and the U.S. president opposed them, he'd be accused of jeopardizing the security of a close ally. It is a no-win situation of galactic seriousness for this president. And as a result, finding a way to prevent Iran from weaponizing remains his highest foreign policy priority in the Middle East.
The Syrian tar baby
I've long believed but lack the empirical evidence to support it, that one of the main reasons that Obama -- wisely and willfully -- wanted to avoid getting involved in the Syrian civil war was the complications it would cause in finding a way out of the Iranian nuclear morass. The conventional wisdom in Washington has long been precisely the opposite -- That Syria offered an opportunity to weaken Iran; that undermining Assad by heavily supporting the opposition with military assistance , even the direct application of American military force, would weaken Teheran by striking at its key Syrian ally -- and Hezbollah too. This was deemed to be the new Great Game -- a smart and savvy move on the Middle East chess board.
The fact that for the past three weeks as the president debated what to do about Syrian chemical weapons capacity, he had also secretly engaged in an exchange of letters with Iranian President Hassan Rouhani that offered new flexibility with regard to a deal on the nuclear issue should give us pause as to whether Obama saw the Syrian situation the same way many analysts did. You might even make an argument that hastening al-Assad's demise might actually accelerate Iran's quest for a nuclear weapon as the mullahs felt the western-Sunni arc threatening a Shia Iran.
In fact, Obama may have well argued that hammering Damascus and engaging in a proxy war with the mullahs and likely the Russians too would have a made an Iranian deal harder to accomplish, particularly if a military strike hit Iranian assets in Syria. Indeed the president also presumably realized that he'd need the Russians on board any deal with Iran too and that a gigantic standoff with Putin over Syria wouldn't help.
It's clear that the threat of the U.S. striking Syria motivated Putin and perhaps al-Assad to an engage in a political process on chemical weapons. But how much impact that threat had in Tehran is an open question, particularly against the backdrop of so reluctant a U.S. public and Congress. Is it possible that the president's letter and his willingness to forgo force in Syria in favor of a diplomatic option might have preserved the prospects of deal with the mullahs? Can the prospect of diplomacy -- like the use of force -- work to deter, too? We'll see.
Governing is about choosing. And in seeking to stay out of militarizing the U.S. role in the Syrian civil war Obama has made a choice. He's been attacked for it and is likely to continue to be. Indeed, the U.S.-Russian deal to rid Syria of all chemicals weapons -- an iffy prospect at best -- won't rid Syria of al-Assad. In fact, it might just guarantee that he stays. Indeed, U.S. diplomacy with the mullahs on the nuclear issue -- like its diplomacy with the Russians on chemical weapons -- would tend to reinforce that status quo.
But Obama would accept an imperfect deal on Syrian chemical weapons and al-Assad in place nonetheless. To resolve one of the world's greatest challenges -- how to stop Iran from acquiring a nuclear weapon -- without a resort to America's or Israel's using force -- would be the most significant foreign policy achievement of his presidency. He'd earn his Nobel Peace Prize and in the process spare the world a major catastrophe.
It is that and not getting bogged down in Syria that the president wants to leave as a legacy. And next week in New York at the U.N. General Assembly he and his colleagues will begin to test the possibility that an U.S.-Iranian deal really is possible. It's bound to be a long movie and a wild ride, too. But luck, Iran's own calculations, and the president's willingness to use force to demonstrate prudence may well increase the chances of a success.
Follow @CNNOpinion on Twitter.
Join us at Facebook/CNNOpinion.
The opinions expressed in this commentary are solely those of Aaron David Miller.