WASHINGTON When push came to shove in the closing hours of marathon negotiations in Geneva on Iran's nuclear program, it was President Barack Obama, back at the White House, who approved the final language on the U.S. side before the historic deal was clinched.
It was perhaps only fitting that Obama had the last say. His push for a thaw with Tehran, a longtime U.S. foe, dates back to before his presidency, and no other foreign policy issue bears his personal stamp more since he took office in early 2009.
Behind the risky diplomatic opening is a desire for a big legacy-shaping achievement and a deep aversion to getting America entangled in another Middle East conflict - motives that override misgivings to the Iran deal expressed by close allies Israel and Saudi Arabia.
That may explain why Obama, even as he left the troubleshooting to Secretary of State John Kerry and gave him much of the credit for securing the diplomatic coup, has taken "ownership" of the Iran issue like no other.
His engagement - both in private and in public and according to aides, at a level of minute detail - is in contrast to a more aloof approach as Egypt came under military rule and Syria descended into civil war.
"It's the top item on his foreign agenda for the rest of his term," a source close to the White House's thinking said of the Iran issue. "He doesn't want to leave anything to chance."
The stakes are enormous for Obama. If the talks break down and Iran dashes to build an atomic bomb before the West can stop it, he could go into the history books as the president whose naivete allowed the Islamic Republic to go nuclear.
The breakthrough with Iran is also worrying the many pro-Israel members of Congress, including heavyweights in his own Democratic Party like Senator Charles Schumer.
Last weekend's Iran pact - a preliminary agreement on modest sanctions relief in exchange for temporary curbs on Iran's nuclear activities - was no case of accidental diplomacy.
Obama promised to seek direct engagement with Iran and other U.S. enemies during the 2008 presidential campaign, drawing accusations from Republicans that he was promoting appeasement.
He then used his first inaugural address in 2009 to offer to extend a hand if the Iranian leadership would "unclench their fist." After being snubbed, he galvanized international support for crippling sanctions that ultimately forced Tehran into the latest negotiations.
Obama instructed his aides to arrange the historic telephone conversation he had with Iran's relatively moderate new president, Hassan Rouhani, in September, and authorized secret bilateral talks that laid the groundwork for the more formal Geneva rounds between Iran and world powers, U.S. officials say.
On Saturday, Kerry spoke by phone to Obama from Geneva to discuss the outstanding issues in the final tense stages of negotiations, a senior State Department official said. "This went all the way up to (Obama) personally approving the final language," the official said.
While it may not be unusual for Obama to cast his trained legal eye on government-to-government agreements, his close attention to the wording of the deal-in-the-making underscored the sensitivity of the breakthrough document and his determination to get it right.
Once the deal was signed in Switzerland, Obama stepped in front of the cameras at the White House in a rare late-night appearance and hailed it as "an important first step toward a comprehensive solution that addresses our concerns."
It was a chance to tout a foreign policy accomplishment at a time when Obama is struggling with a flawed healthcare rollout and low approval ratings at home.
AVOIDING MILITARY CONFLICT
Obama's words on Saturday night were also infused with an appeal for patience, reflecting the hope that he can escape any decision on going to war with Iran by doing everything possible diplomatically to prevent it from developing a nuclear weapon.
"I have a profound responsibility to try to resolve our differences peacefully, rather than rush toward conflict," Obama said.
Shaping Obama's thinking are the shadows of long, costly wars in Iraq and Afghanistan. His own aversion to new military interventions - underscored by his last-minute refusal to attack Syria in September - is matched by war-weariness that most polls show has permeated the American public.
There can be little doubt that Obama - who meets with presidential scholars and is said to be keenly interested in his place in history as America's first black president - also feels the allure of detente with Iran as a crowning achievement in what has been widely perceived as a less-than-stellar foreign policy record.
"Resolving the Iran issue would be a huge boon to his legacy," said Colin Kahl, a former Pentagon official involved in Iran policymaking who now teaches at Georgetown University.
Iran has long been a key part of Obama's nuclear disarmament agenda - a diplomatic push that helped him win a Nobel Peace Prize so early in his presidency that many questioned whether he deserved it.
CAN MOMENTUM BE SUSTAINED?
There is no guarantee that Obama will be able to sustain the momentum of the Geneva talks as critics at home and abroad accuse the president of giving up too much for too little.
Conservative critics say Obama's distaste for intervention, in particular his shying away from the bombing of Syria over chemical weapons use, has hurt U.S. credibility with Iran, a key ally of Damascus, and across the Middle East.
"One has to wonder if a better deal would have been possible ... had Iran believed there was a real military threat and had the United States not seemed to be so very desperate for a deal," said Elliott Abrams, a foreign policy aide under Obama's predecessor, George W. Bush.
Foremost among Obama's motives for a deal with Iran is to keep Washington from facing the prospect of another war in the Muslim world should there be no other way to keep Tehran from getting the bomb. Iran denies it seeks a nuclear weapon.
Obama was elected on a platform of opposition to the Iraq war, and many of the foreign policy decisions he has made in nearly five years in office have demonstrated a deep wariness of letting America get militarily involved in foreign crises.
"What we're seeing again with Iran is a kind of ‘Obama doctrine' - get America out of old wars and don't get us into risky new ones," said Aaron David Miller, a former Middle East negotiator now at the Woodrow Wilson International Center.
Obama also needs to convince anxious Middle East allies to at least tolerate efforts to hammer out a comprehensive deal.
"For the Saudis and Israelis, the key will be knowing that the pressure of the existing sanctions will be maintained, that evasion will be blocked, and that we have a clear idea of what we will not permit in any end-game deal," said Dennis Ross, a former Middle East adviser to Obama.
The White House denies insinuations from friends and foes in the Middle East that Obama does not have the stomach to use force in the region and points to the overthrow of Libyan leader Muammar Gaddafi in 2011. Even in that case, Obama was accused of "leading from behind" when he opted for a mostly backup role in the NATO air assault there.