In 1953 an American administration joined England’s MI6 and Iranian royalists and clergy in toppling the democratically elected government of Mohammed Mossadeq; in 1971 another threw caution to the wind and indulged the Shah’s insatiable appetite for things military; yet another, in the early 80s, ignored its own tough anti-terror rhetoric and sold arms to Iran in return for a mere promise of help in freeing American hostages in Lebanon (while also providing Iraq with arms and satellite intelligence to fight Iran); that same administration professed ignorance of Saddam Hussein’s criminal use of chemical weapons against Iran; the last administration rejected reformist pleas for rapprochement and spoke of “regime change,” naming Iran a part of the “Axis of Evil”; and, finally, a recent presidential candidate offered an off-key rendition of a Beach Boys song, suggesting that to “bomb, bomb, bomb” Iran was a viable policy.

This history is part of the karmic baggage the Obama administration carries in dealing with Iran. Some of these decisions may have served U.S. interests at the time, but they all left lasting scars on Iran’s collective memory, limiting possibilities for meaningful American engagement with Iran.

The Republicans, who are responsible for much of this grim history, have lately criticized the Obama administration for not “doing enough” on Iran. The criticisms—really slogans—are about supporting people’s democratic struggle or “keeping all options open.” The military option would be a human disaster, and seems particularly ill-advised now. Engulfed in a major political crisis, with the ruling elite embroiled in the most serious feud in its three decades, the Iranian regime would benefit from a military attack. Indeed, desperate to consolidate power and discredit challengers, the regime has publicly associated dissent in Iran with a U.S. conspiracy. A full week before the election, the political organ of the Revolutionary Guards—Sobhe Sadeq (True Dawn)—declared that the campaign of the reform candidate Mir-Hossein Mousavi was part of a “velvet revolution” masterminded by the United States.

Putting aside the Republican distractions, what should the goals of American policy be? In brief, the United States wants a regime in Iran that does not seek a nuclear bomb and does not strangle the oil market by threatening the flow of oil from the Persian Gulf; a regime that is more democratic, more stable, less confrontational, less likely to support groups like Hezbollah and Hamas. The United States also wants to maintain the good will of the people of Iran, the only Muslim-majority state with a population favorably disposed toward the United States. At the same time, the United States must also be wary of Chinese and Russian efforts to increase their own power in Iran.

These concerns are very hard to balance, especially against the background of past policy. The current crisis makes the balance harder still, but perhaps also offers an opportunity.

Soon after the contested June presidential election in Iran, many of Iran’s big cities erupted into massive, peaceful demonstrations. Almost 40 million handwritten ballots needed manual counting, but the government declared the incumbent Mahmoud Ahmadinejad the winner of a landslide only two hours after the polls closed. The tyrannical triumvirate—Iran’s Supreme Leader Ayatollah Khamenei, Ahmadinejad, and the Islamic Revolutionary Guard Corps—pulled off the electoral coup, although they have not yet succeeded in anointing Ahmadinejad the next president.

It is possible, though not likely, that the surprisingly militant and resilient trinity of the losing presidential candidates Mousavi and Mehdi Karroubi and former President Mohammad Khatami, supported in the shadows by former President Akbar Hashemi Rafsanjani and millions of Iranian citizens, can succeed in rolling back the power grab. These forces—the most vigorous being women and young people—have already put a virtual end to the system of Velayat-e Fagih (the Rule of the Jurist), where the words and commands of Khamenei, and Ayatollah Khomeini before him, were, in the parlance of regime apologists, Fasl-ol Khetab (Debate Terminator). Once the Leader spoke, all factions would fall in line and follow his orders. Not only have Mousavi and Karroubi defied Khamenei, but they have also implicitly called him a despot and a liar; millions of Iranians have demanded his downfall, even death. Khamenei, breaching the tradition of appearing above factional feuds, has forfeited any claim to impartiality—an essential part of his job description. Even if he survives the current crisis with his position, he will no longer be the ruling jurist who speaks for God and whose words have the force of law. He has become a despot supported by the military might of the Revolutionary Guards and by the terror unleashed by the Basij, government-sanctioned gangs responsible for much of the killing and abuse of protesters.

While the tyrannical triumvirate continues desperately to trace opposition politics to American machinations, President Obama has so far calibrated his statements carefully to developments in Iran. He has avoided partisan politics that might harm U.S. long-term strategic interests and managed to at least partially realize both U.S. interests and ideals: he has offered support for the Iranian people, and sternly criticized the triumvirate’s brutalities, without giving Iran’s regime any excuse to claim credibly that his administration is interfering in Iran’s domestic affairs. At the same time, the United States has joined European allies to pressure the regime to refrain from even more violent repression, while keeping open the possibility of negotiations.

Meanwhile the brutality in Iran continues, but the regime’s growing weakness is beginning to show. In the most recent issue of Sobhe Sadeq, the tyrannical triumvirate describes how they will reassert control and force opponents into submission or silence. They divide their opposition into three interlinked circles—the largest circle includes the mass demonstrators. The bulk of those, the regime believes, can be convinced to stay home by terror and intimidation, validated by the words of the Supreme Leader. Agents of the triumvirate have arrested close to two thousand in the second circle: journalists, writers, intellectuals, and clerics who support the opposition. There are reports that the entire campaign staffs operating in small towns for Mousavi and Karroubi have been arrested. The candidates and their immediate advisors are the last circle. Mohsen Rezai, the third loosing candidate, has already thrown in the towel and withdrawn his objection to the Guardian Council, the supposedly impartial government body responsible for adjudicating electoral complaints. But the other two have remained defiant. Sobhe Sadeq warns that if the two candidates, deprived of support from the other two circles, continue to defy the words of the triumvirate, they will be forced into silence.

The triumvirate’s plan of repression has hit several snags. Mousavi and Karroubi have emerged more defiant and resilient than even many of their closest allies imagined they would. Their supporters in big cities have also shown remarkable bravery. Smaller cities have fallen silent, but this cannot be construed as a sign of their support for the triumvirate. In these towns, the Basij know every citizen and can easily identify every family’s movements. The inhabitants of big cities have the advantage of anonymity. Finally, the extensive social networks built long before the election by Iranian women in their movement against state misogyny and by technologically savvy young Iranians have enabled the opposition to surmount the regime’s news blackouts and organize massive rallies. The surge of support from concerned citizens around the world—help in setting up proxy servers; breaking regime filters to avoid electronic monitoring—strengthened these networks and emboldened the activists. The regime was taken by surprise and, for the first few days, forced into erratic behavior.

If Ahmadinejad holds onto power, his administration will be weakened domestically and isolated internationally. The triumvirate’s only clear source of support will be the Revolutionary Guards, the Basij, and the minority of the citizens—such as families of soldiers killed in the Iran-Iraq War—whose livelihoods depend on the regime. With a failing economy in desperate need of foreign investments, the triumvirate will, in spite of its bombast, need to negotiate with the United States.

In the improbable case that the democratic trinity succeeds in rolling back the power grab, the resulting Mousavi administration would enjoy popular support and work for the people, not the clerics or the Revolutionary Guards. As a controversial, recent poll conducted by the U.S. survey group Terror Free Tomorrow has shown, the Iranian populace favors improved relations with the United States, which would include recognizing the State of Israel. The people also want their government to provide adequate guarantees to the world about its nuclear program.

Perhaps karma is not fate. A mix of prudent American diplomacy and continuing clerical error in Tehran might produce a decent outcome both for the United States and, most fundamentally, for the Iranian people.