Mohamad Bazzi (@BazziNYU), a Lebanese-American journalist, is the former Middle East bureau chief for Newsday. He is currently teaching journalism at New York University, and writing a book on the proxy wars between Saudi Arabia and Iran.

In early July, as his negotiators were working around the clock in Vienna to reach an agreement with world powers on limiting Iran’s nuclear program, Iranian President Hassan Rouhani was back in Tehran recalling an event that happened nearly 1,400 years ago. In a speech, Rouhani invoked the historic compromise made in the year 661 by his namesake, Imam Hassan, Shiism’s second imam, to step down and prevent a new war between the then-emerging Sunni and Shiite sects. “Imam Hassan made an important decision during difficult circumstances that could have destroyed the Muslim community," Rouhani said, "and led to a long period of bloodshed.”

Rouhani wasn’t alone in citing Imam Hassan's legacy. The supreme leader, Ayatollah Ali Khamenei —who has final say in all political and national security matters—also began to invoke the imam in setting the stage for Tuesday’s compromise, calling it a policy of “heroic flexibility.” By repeating this term several times, Khamenei reached back into Shiite history to offer theological rationales for the prospect of a rapprochement with Iran’s Western adversaries.


It is striking that, throughout the past 12 years of on-and-off negotiations with the West over Tehran’s nuclear program, Iranian leaders have used references to Imam Hassan and his younger brother Imam Hussein—and the two historical models for settling conflicts that these figures represent—to signal their intentions, both hardline and soft, and provide theological justifications for their actions. Hassan’s path emphasizes compromise (or, to its hardline critics, accommodation), while Hussein chose rebellion and martyrdom. These two trends defined Shiite history—and they are an important part of the religious and ideological debates within the Iranian regime.

Iranian leaders struggled with the two models, and how they should apply to the Islamic Republic’s foreign policy, since Saddam Hussein invaded Iran in 1980, instigating the devastating, eight year Iran-Iraq war. Back then it was the hawkish imam who was cited. By the mid-1980s, after five years of war and international isolation, the Iranian economy was reeling. In 1979, the first year after the Islamic Revolution, Iran’s oil revenue was about $23 billion; by 1986, it had dropped to a record low of $6.2 billion. The revolution’s hardline leader, Ayatollah Ruhollah Khomeini, was under pressure by some of his advisers to accept a United Nations-brokered ceasefire, partly to avert an economic disaster. For several years, Khomeini refused to budge, choosing the example of Hussein. In 1986, he dismissed Hassan’s compromise, saying: “Peace was imposed on Imam Hassan, but we should not accept the same agreement.”

But as the economic crisis became more dire, some of Khomeini’s advisers reframed the argument, noting that the choice was between preserving the Islamic Republic or prolonging the revolution: the Iran-Iraq conflict was threatening the viability of the Iranian system. As hardliners and moderates around Khomeini debated the paths of Hassan and Hussein, Akbar Hashemi Rafsanjani, who was then speaker of the Iranian Parliament (and later became president), championed a compromise based on the models of both imams: a series of military victories that would be followed by a political settlement. Rafsanjani and his allies, who at the time included Rouhani, promoted the idea that while the path of martyrdom set by Hussein required courage, so did the model of peace chosen by Hassan.

In the end, after eight years of mobilizing Iranians with religious fervor and intense nationalist rhetoric, Khomeini accepted the ceasefire, saying he had been forced “to drink from a poisoned chalice.”

Today—after Iran, the United States and five other world powers reached an agreement to limit Tehran’s nuclear program for more than a decade in return for lifting international sanctions—Khomeini’s successor as supreme leader, Khamenei, can claim to have emulated Imam Hassan’s path of compromise. He’s chosen pragmatic politics over revolutionary ideals as his legacy.

***

So who was Imam Hassan, the cleric whose spirit appears to infuse the new rapprochement between Iran and the West? The origins of the Shiite-Sunni conflict go back to the period after the Prophet Muhammad’s death in 632. A schism arose over who would succeed him as caliph, the political and military leader of Islam. One faction argued that the prophet’s heir should be chosen from among his closest companions. The other faction insisted that succession must preserve the prophet’s bloodline, and since Muhammad did not have any surviving sons when he died, his rightful heir was his cousin and son-in-law, Ali. The Shi’at, or Partisans, of Ali emerged out of this movement. The struggle over the caliphate led to the first fitna, or civil war, between Muslims—a term (also meaning sedition) that is still invoked today to warn of sectarian divisions.

The prophet’s followers convened a shura, or consultation, to choose his successor. They passed over Ali and chose one of Muhammad’s companions instead. Ali was passed over twice more, until finally becoming the fourth caliph of Islam in 656. He was assassinated five years later, in the ongoing struggle over who would rule the faithful. The mantle of leadership of the Shiite community then passed to Ali’s eldest son, Hassan. His supporters urged him to lay claim to the caliphate established by a rival leader, Muawiyah, whom Shiites regarded as a usurper.

But in 661, Hassan negotiated a peace treaty with his rival, who had moved the caliphate from Islam’s birthplace in Arabia to Damascus. By relinquishing his claim, Hassan helped Muawiyah solidify his control and establish Islam’s first great dynasty, the Umayyads, who ruled for nearly a century over an expanding empire.

That marked Shiite Islam’s legacy of compromise. But there was another, different legacy left by the assassinated Ali’s son, Hussein. In 680, nineteen years after Ali’s death, Hussein led a rebellion against Muawiyah’s son, the newly installed Umayyad caliph Yazid. Hussein set out from the city of Medina in Arabia with a few dozen supporters. But Yazid sent a force of several thousand troops to intercept Hussein in the Iraqi desert. According to Shiite lore, Yazid’s troops surrounded the caravan and cut it off from the waters of the Euphrates River. The commander of Yazid’s army gave Hussein an ultimatum: swear allegiance to the caliph and be allowed to return home, or face death. Hussein refused. Many of his followers starved or died from thirst during the ten-day siege. Yazid’s troops eventually overran the camp, beheaded Hussein, and displayed his severed head as they made their way back to Damascus—a warning to anyone else who would challenge the caliph’s authority.

The violent deaths of Ali and Hussein became the defining factor in the split between the Shiite and Sunni sects of Islam. They also made martyrdom and rebellion against perceived injustice among the most important tenets of Shiism. But Hassan’s more conciliatory legacy lived on as well.

***

On April 2, Iranian Foreign Minister Mohammed Javad Zarif announced in Lausanne, Switzerland, that his government accepted an interim agreement limiting its nuclear program. In his remarks to Iranian journalists, Zarif praised his boss, the supreme leader Khamenei, for his “heroic flexibility.” Zarif’s reference did not register in Western coverage of the interim deal, but it resonated in Iran—a signal to hardliners that the emerging deal has Khamenei’s blessing, and they should not try to undermine it.

Khamenei first used the term in September 2013, when he told a group of Iranian Revolutionary Guard commanders that he is open to more flexible engagement with the outside world—essentially blessing the latest round of negotiations with the United States and five other world powers. “I am not against proper political moves in diplomacy. I believe in what was described many years ago as ‘heroic flexibility,’” Khamenei said. “On certain occasions, flexibility is positive and very beneficial.”

But the ayatollah also laid out the parameters of negotiations and emphasized the need to understand the goals of opposing powers. “A wrestler sometimes shows flexibility for technical reasons,” he said. “But he should not forget who his opponent and enemy is.”

After his speech, Iranian journalists tried to decode the supreme leader’s reference and found that in 1969, as a thirty-year-old junior cleric, Khamenei translated a book from Arabic into Farsi titled, “Imam Hassan’s Peace.” Khamenei, who would later boast that his contemporary political decisions are guided by examples from Islam’s early history, had subtitled the book, “The Most Splendid Heroic Flexibility in History.”

The ayatollah’s speech in 2013 followed a yearlong economic crisis precipitated by severe international sanctions, including a European Union oil embargo and asset freeze on Iran’s central bank. Some economists and analysts compared that crisis to the final years of the Iran-Iraq war. Indeed, Khamenei’s rhetoric began to shift as sanctions and the economic squeeze tightened. In the past, Khamenei had echoed his predecessor’s criticism of Hassan’s compromise as an “imposed peace,” which the Islamic Republic could not accept in its dealings with Western powers. “Neither the United States nor anyone stronger than the United States is able to impose a situation like Imam Hassan’s peace treaty on the Islamic world,” Khamenei said in May 2000, during an earlier round of negotiations.

In his recent speech commemorating Imam Hassan’s birthday, Rouhani, the reformist president elected in 2013 on a wave of popular resentment against economic hardship, tried to emphasize that the model of compromise favored by Hassan requires courage and personal sacrifice, just like the stoicism and martyrdom of Hussein. In doing so, Rouhani tried to frame a nuclear agreement as an “honorable peace,” one that combines the methods of both Shiite imams—repeating the argument that helped persuade Khomeini to end the Iran-Iraq war. Of course, Rouhani’s ultimate rhetorical target was Khamenei, who needed other leaders to reinforce the theological justifications for making a deal.

Now that a nuclear agreement has been reached, Khamenei will be able to cast his legacy as that of the leader who stood his ground against the United States, but then showed “heroic flexibility” by comprising for Iran’s greater good.