A handout picture released by the White House on April 1, 2015 shows President Obama and Vice President Biden, with the national security team, participating in a secure video teleconference from the Situation Room of the White House on March 31, 2015, with Secretary of State John Kerry, Energy Secretary Ernest Moniz and the U.S. team negotiating with Iran about their nuclear program in Lausanne, Switzerland. (White House / Pete Souza/EPA)

Much of President Obama’s foreign policy agenda has been foisted upon him during his six years in office. He inherited two wars, in Iraq and Afghanistan, neither of which he’s been able to end. He’s had to react to chaos in the Middle East and a Russian incursion in Ukraine.

The negotiations with Iran over its nuclear program are a different matter. They are Obama’s choice, and he’s fought to keep them moving since the beginning of his presidency despite setbacks and second-guessing from Republicans, fellow Democrats and longtime foreign allies.

The latest setback came Wednesday when the White House agreed, for a second time in two days, to suspend its self-imposed March 31 deadline for an agreement, amid complaints from the United States and its allies that Iran was not offering serious counterproposals.

Secretary of State John F. Kerry said he would stay in Switzerland and continue negotiations until at least Thursday morning.

President Obama announced that negotiators from Iran, the U.S. and other countries agreed to a framework for a final agreement to curb Tehran’s nuclear program. (AP)

The president’s decision to keep negotiating reflects both the importance he has placed on the talks and his particular view of how American leadership, persistence and engagement with enemies can change the world.

Obama often talks about moments in which U.S. leadership can “bend the arc of human history.” An Iran accord represents exactly such an opportunity, but it is also one of the most risky foreign policy gambles of his presidency.

The talks revolve around an issue — nuclear proliferation — that has been a major focus for Obama since he first arrived in Washington. As a senator, he called for a world without nuclear weapons. As president, his first foreign policy speech focused on the dangers that a terrorist group, such as al-Qaeda, might someday acquire a nuclear bomb.

“If we believe that the spread of nuclear weapons is inevitable,” he told a crowd of thousands in Prague’s main square, “then in some ways we are admitting to ourselves that the use of a nuclear weapon is inevitable.”

The Iran talks also reflect his abiding belief that the best way to change the behavior of hostile governments with spotty human rights records is not through isolation or the threat of military force, but by persistent engagement. In recent years, Obama has pushed to open up trade and diplomatic relations with countries such as Cuba and Burma.

“He believes the more people interact with open societies, the more they will want to be part of an open society,” said Ivo Daalder, Obama’s former NATO ambassador and head of the Chicago Council on Global Affairs.

Iran, a longtime enemy and sponsor of some of the world’s most potent militias and terrorist groups, is the biggest and boldest test of Obama’s theory.

Some critics worry that the president’s eagerness to strike a deal has led the administration to minimize its potential costs. “They are captivated by the vision of an Iran as a potential source of strategic stability in a region that’s falling apart,” said Peter Feaver, a Duke University political science professor who was a White House official in the George W. Bush administration. “They would never be so naive to describe it that way, but you can tell that’s a hope.”

Even if the United States and its allies secure a deal with Iran, the accord could backfire. Iran could cheat, although evading intrusive inspections will be difficult for the Islamic republic, said White House officials. If U.S. allies, such as Saudi Arabia, think that the accord doesn’t do enough to prevent Iran from obtaining a nuclear weapon, they could start their own program, triggering an arms race in one of the most dangerous and unstable regions of the world.

The most immediate concern is that an emboldened Iran will use the financial windfall that comes with the easing of economic sanctions to boost support to its proxy militias in a region that is already being torn by sectarian war.

Obama has acknowledged those risks but insists that the alternatives to an Iran deal — tighter sanctions or military strikes — would be much worse. As the negotiations have progressed, Obama has become more personally involved in the talks, said current and former aides. He can describe in minute detail the number and type of centrifuges that Iran would be allowed to retain under a deal.

In public comments, he has often put the chances of striking an accord at less than 50 percent. Privately, aides said, he has demanded briefings on every minor setback and reversal. His personal involvement demonstrates how important the negotiations have become to his presidency.

Obama and senior aides have bemoaned what they see as a tendency in Washington to look first to the military to solve America’s most vexing foreign policy problems. “The debates around the Middle East don’t seem to recognize that the Iraq war took place,” said Ben Rhodes, a deputy national security adviser to the president. There continues to be “an instinctive reach for military solutions as the only sign of America’s seriousness,” he said.

The Iran negotiations, for Obama, offer a new model. The talks have played down threats of U.S. military force and instead placed a heavy emphasis on American diplomacy and statecraft. The United States has acted as part of a broad international coalition that includes Russia and China, a change from an earlier era in which Obama insisted the United States had too often ignored its allies and tried to go it alone.

The negotiations are also personal for the president. Obama was dismissed as dangerously naive in 2007 by then-candidate Hillary Rodham Clinton for suggesting that he would engage in “aggressive personal diplomacy” with Iran. More recently, House Speaker John A. Boehner (R-Ohio) invited Israeli Prime Minister Benjamin Netanyahu to address a joint meeting of Congress, where the Israeli leader leveled the same charge. Netanyahu’s speech infuriated the White House. Two weeks later, 47 GOP senators sent an open letter to Iran’s leaders warning that a future president or Congress could undo any agreements the administration and its partners reached with Tehran.

“There’s a determination to prove the Republicans wrong, and to prove the world wrong,” said Julianne Smith, a former deputy national security adviser to Vice President Biden and senior fellow at the Center for a New American Security.

An accord with Iran also would give credence to Obama’s core belief that the United States must be open to negotiations with its enemies. In 2007, the then presidential candidate said it was a “disgrace” that the Bush administration had not done more to talk with U.S. enemies in the Middle East. “The notion that somehow not talking to countries is punishment to them — which has been the guiding diplomatic principle of this administration — is ridiculous,” Obama said.

In Iran, Obama has chosen to negotiate with one of the United States’ biggest and most destabilizing enemies. Iranian money, weapons and combat advisers have helped President Bashar al-Assad cling to power in Syria. In Lebanon and Yemen, Iranian-backed militias have sown unrest against U.S. allies. Iran’s support has helped Hamas launch deadly attacks on Israel, the closest U.S. ally in the region.

Although Iran is working alongside the United States in Iraq to destroy Islamic State insurgents, Iranian-backed militias were responsible for some of the deadliest attacks on U.S. troops before 2011. It is Iran’s potential as a stabilizing force in the region that gives it such allure. “They’re a big, sophisticated country with a lot of talent,” Obama said in an interview with the New York Times in the summer. Even a moderately less threatening Iran could pay big dividends at a time when the Middle East’s post-World War I order is coming apart.

“With all this turmoil in the Arab world, you need a workable relationship with the other side,” said Shawn Brimley, a former director for strategic planning in the White House. “You can’t argue with Iran’s importance in the region. That’s why Obama is taking this extremely seriously.”

Juliet Eilperin contributed to this report.

Read more:

Poll: Clear majority supports nuclear deal with Iran

In Iran nuclear talks, it’s all in a name

Another nation blazed the trail for Iran in developing a nuclear program

The big questions any nuclear deal with Iran would have to answer

The key moments in the long history of U.S.-Iran tensions