Since the earliest days of his Administration, President Barack Obama has sought to engage Iran's leaders in the search for diplomatic solutions to the standoff over Tehran's nuclear program and other points of conflict. But in the days since protests exploded in the streets following the re-election of Iranian President Mahmoud Ahmadinejad, many U.S. observers have suggested that prospects for engagement and reconciliation have dimmed.Republicans and even centrist Democrats have pressured the Administration to take a harder line against Iran, and even left-leaning politicians who once pushed for engagement now say a diplomatic initiative appears unseemly given the accusations of vote-rigging by the Iranian government and the security forces' brutal response to the protests. Vice President Joe Biden's July 5 comment that the U.S. wouldn't stand in the way of an Israeli air strike on Iranian nuclear sites made it sound as if the Administration's message in favor of engagement was slipping.And yet the current upheaval in Iran could provide one of the best opportunities the U.S. has to negotiate a new compact to stabilize the region. That's because the turmoil in Iran actually gives Washington new leverage over those elements in Tehran — hard-line clerics and the security chiefs — who once stood in the way of détente but who are now furiously working to legitimize Iran's government in response to a domestic political challenge.Anti-Americanism and its handmaiden, anti-Zionism, have long been ideological tools used by the mullahs, both domestically and regionally, to reinforce the legitimacy of their rule. Iran's Islamist democracy and willingness to challenge the U.S. and Israel have resonated throughout the Middle East with Arab populations frustrated with their own autocratic leaders, whom they perceive as doing Washington's bidding. But Tehran's appeal required a fig leaf of democracy: for all its flaws, Iran has been one of the more democratic countries in the Middle East.No longer. Iranian democracy is now questioned by millions of Iranians who believe that their government rigged the elections. Though they clearly don't have the power to take on the state directly, those protesters have Tehran's establishment worried. The Iranian government knows it needs at least a passive acceptance by its citizenry of the new state of affairs, or else Iran's cities will have to become permanent garrisons under constant emergency rule.Many of the protesters were (and are) young Iranians, who are literally the future of the country — more than half of all Iranians are under the age of 30. Having clamped down on civil and political rights, the Iranian government will more than ever have to produce jobs for this new generation — much in the way the Chinese Communist Party maintained power after the Tiananmen Square crackdown in 1992 by providing a steady stream of economic growth.But that will be increasingly difficult if Iran continues on its collision course with the West. By blaming civil unrest on foreign governments, especially the British, and by arresting Iranian employees of the British embassy in Tehran, the Iranian government has unified the European Union — Iran's largest trading partner — and pushed it closer to the U.S., which maintains economic sanctions against Iran.Iran's domestic economic needs require that the nation break its isolation. And its leaders know that the symbolic trappings of international acceptance could help build legitimacy at home. Indeed, throughout the crisis, Iran's government has shown it remains sensitive to its image on the world stage, announcing that its relations with foreign countries will depend on how they viewed the results of the disputed elections. For all its Britain-bashing, Iran has been less damning about alleged American interference, leaving the door open, perhaps, for future talks.Critics have suggested that engagement stands little chance of success while Iran's leadership is in such disarray. But, in fact, for the first time it's quite clear exactly who is in charge in Iran: a relatively small number of hard-line politicians backed by Supreme Leader Ayatullah Khamenei and the security services that support them. They are the very people who have the power to deliver on a deal, because they are the ones in control of Iran's controversial policies, especially the nuclear program, and Iran's ongoing support for the anti-Israel militant groups Hamas and Hizballah.Turning a blind eye to the Iranian government's crackdown may strike some as a betrayal of the million of Iranians who took to the streets. But the reality is that without an agreement over Iran's nuclear program, a nuclear arms race in the Middle East will threaten far more lives than club-wielding Iranian policemen.