More than 6,200 candidates began campaigning last week in a pair of elections scheduled for February 26 that could determine whether or not Iran moves toward greater engagement with the rest of the world, following Tehran’s historic accord with the United States and other world powers over its nuclear program.

A coalition of pragmatists, center-right moderates, and reformists, backed by the administration of President Hassan Rouhani, is challenging the hawks and hard-liners who currently dominate Iran’s parliament. And, in a parallel election, allies of Rouhani and former President Ali Akbar Hashemi Rafsanjani will try to make gains in the so-called Assembly of Experts, the 88-member clerical body that oversees Iran’s supreme leader—and that will choose his successor if the current leader, Ayatollah Ali Khamenei, 76, dies in office.

“The next parliament could be much friendlier to Rouhani,” Ali Vaez, senior Iran analyst for the International Crisis Group (ICG), told The Nation. “That won’t mean that Rouhani gets the upper hand, but at least he’ll have a chance of diminishing or weakening the hard-line faction.” The current parliament, or Majlis, is dominated by that faction because, during the 2012 election, moderates and reformists largely boycotted the vote. (They were angry and discouraged because that vote followed the controversial 2009 presidential election, in which hard-line President Mahmoud Ahmadinejad was re-elected amid widespread charges of irregularities and vote stealing.)

In 2013, however, moderates and reformists shook off their lethargy to support Rouhani’s campaign, in which he promised to seek a deal over Iran’s nuclear program and take steps to liberalize domestic politics. Rouhani won handily, getting more than 50 percent of the vote against an array of ultraconservatives. He hopes that a strong showing this year will bolster his chances for re-election as president in 2017.

“This election will prove whether 2013 was an aberration or not,” Hadi Ghaemi, executive director of the International Campaign for Human Rights in Iran, told The Nation. “If Rouhani doesn’t get a cooperative parliament, he may very well be Iran’s first one-term president. What happens this week will be very significant for his future.”

Often portrayed as a dictatorship, Iran’s politics are in fact notoriously complicated. Though Khamenei controls or influences many levers of power—including the judiciary, the secretive Guardian Council, and the Revolutionary Guards—both the parliament and the executive branch, led by Rouhani, have significant clout. A parliament less influenced by the radical right and ultraconservative clerics would give Rouhani leverage as he attempts to capitalize on the nuclear deal and the lifting of economic sanctions to strengthen economic ties with partners in Asia, Western Europe, and even the United States. At the same time, Rouhani could finally take baby steps to release political prisoners, allow greater media freedom, and expand civil rights protections.

Gary Sick, senior research scholar at Columbia University’s Middle East Institute who served as President Jimmy Carter’s Iran specialist on the National Security Council, notes that while Khamenei quieted hard-liners who opposed the nuclear deal, he is likely to be less supportive if Rouhani seeks further economic openness and domestic reforms.

“During the nuclear talks, Khamenei realized that if Iran didn’t open up a little and get sanctions lifted, the revolution was going to go down,” Sick told The Nation, adding that the ruling elite was losing whatever support it had among Iran’s under-30 majority. “At the same time, however, for his own political survival, he depends on the Revolutionary Guard and the hard-liners. He took a gamble by supporting the nuclear deal, but he ended up with a lot of unhappy hard-liners, and now he’s likely to tack back in the other direction.”

Under normal circumstances, Rouhani would go into the elections with a strengthened hand as a result of the nuclear agreement, especially since ending Iran’s political and economic isolation was a key plank in his 2013 campaign. By all accounts, the accord is overwhelmingly popular. A recent poll by the University of Maryland concluded that nearly three-quarters of Iranians backed the accord and that more than four-fifths approve of Rouhani. Iranians welcomed the agreement not least because it ended the sanctions that have staggered the country’s economy over the past decade, even though the impact of lifting them has yet to be felt on the street (they went into effect only in mid-January).

But in the February 26 vote, Rouhani and his allies do not have a level playing field. In January, more than 12,000 people applied to run as candidates for parliament, but the Guardian Council—the 12-member body that has ultimate authority over who can run in elections, and whose members are hard-line clerics and jurists appointed by Khamenei and by the parliament itself—purged more than half of them, preventing them from running. Of the 3,000 reformists who sought to run—mostly allies and followers of both reformist former President Mohammad Khatami and Mir Hossein Mousavi, who ran for president in 2009 against Ahmadinejad—only 1 percent, or 30 candidates, were approved. And thousands of other independents and moderates were blocked, too. (No surprise: Mousavi was arrested in early 2011 and, along with his wife, Zahra Rahnavard, an artist and intellectual, and Mehdi Karroubi, who also challenged Ahmadinejad, has been under house arrest ever since. Khatami, who was president from 1997 to 2005, has been relegated to the status of a nonperson whose photograph cannot appear in Iranian media and who cannot be quoted.)

It seemed at first as if the Guardian Council had eliminated any possibility that hard-liners would lose their grip on the parliament. But the Rouhani administration didn’t take the purges lying down. In a fiery statement, Rouhani slammed the Guardian Council’s actions. “The parliament is the house of the people, not a particular faction,” he said, adding—in a reference to the reformists—“What about a faction that has 10 million supporters?”

Rouhani was especially unhappy with the council’s disproportionate disqualification of female candidates (only 9 of the 290 MPs are women). “How can a country talk of development and progress while ignoring 50 percent of the population?” he asked. He dispatched Deputy Interior Minister Hossein Ali Amiri to challenge the Guardian Council’s actions, and he won a partial victory when more than 1,500 previously barred candidates were approved. “Reformists, moderates, and conservatives are among the newly approved,” Amiri announced. At least 70 members of the reformist bloc and numerous moderates and independents ultimately were added to the ballot, according to the ICG’s Vaez.

Battle lines were quickly drawn. Several far-right parties assembled election lists of their supporters, led by the so-called Grand Coalition of Principlists. On the other side, Mohammad Reza Aref, a former vice president under Khatami, announced the creation of the Alliance of Reformists and Government Supporters. Although there will be as many as 20 or more candidates on the ballot for each seat, Iranian voters are likely to gravitate toward lists organized by one of the two main factions, says Ghaemi. “A lot of the candidates are unknown, especially in the provinces,” he says. “But there are essentially two main, competing lists, one made up of Rouhani supporters and the other with people from the hard-line faction; and voters will go with one list or the other.” Making the results more difficult to predict, however, Iran-watchers say that many of the candidates are independents with ties to local supporters or would-be recipients of patronage, including construction projects and other pork-barrel spending, as well as tribal alliances. Once elected it isn’t clear with whom they’ll align in the new Majlis.

In addition to the Majlis elections, voters will also choose the makeup of the new Assembly of Experts, whose members are usually chosen from the ranks of elderly, conservative clerics and who serve eight-year terms. A little-known body outside Iran, the assembly monitors the supreme leader during his tenure. In extreme circumstances, it can oust him. And its most important charge will be to select his successor. Among its current members are Rouhani himself and Rafsanjani, a wealthy businessman and wheeler-dealer who in recent years has largely aligned himself with center-right politicians and reformists. Because of his extensive business connections, Rafsanjani is a strong supporter of getting rid of the sanctions regime and opening up Iran’s economy to the rest of the world. Of the more than 800 candidates who sought to compete for a spot in the Assembly of Experts, more than 80 percent—including all of the female candidates—were purged by the Guardian Council. Predicting what the assembly will look like after the vote is very difficult, but several Iran-watchers told The Nation that, despite the purges, it’s conceivable the Rouhani-Rafsanjani alliance could end up wielding considerable power once the dust clears.

Back in 1989, after the death of Ayatollah Ruhollah Khomeini, the founder of the Islamic Republic, it was Rafsanjani who manipulated Iran’s factions to install Khamenei—and, at the same time, catapult himself into Iran’s presidency, a post he held from 1989 through 1997. “Rafsanjani stage-managed the succession in 1989, and he is extraordinarily clever. He knows all the angles. And he’s very good behind the scenes,” says Sick. This time around, Rafsanjani angrily protested when the Guardian Council barred Hassan Khomeini, the founder’s grandson, from running for the Assembly of Experts. “Where did you receive your qualifications?” raged Rafsanjani. “Who have you permission to judge?” According to The Guardian, Saeed Abutaleb, a former hard-liner who now supports Rouhani and Rafsanjani, has suggested that after the vote Rafsanjani could even emerge as chairman of the Assembly of Experts, giving him enormous leverage in choosing Khamenei’s successor.

For Khamenei, the paradox of the current situation is that while Iran desperately needed to break out of its economic isolation, he and his allies are terrified that an influx of foreign businessmen and investors could undermine Iran’s rigid internal controls and increase pressure for further democratic change. (Indeed, while Rouhani touts the benefits of international economic cooperation and recently returned from a triumphant tour of Western Europe, Khamenei frequently supports the idea of what he calls a “resistance economy” and autarky.) “There is real fear within the system, especially in the unelected part of the system [i.e., the Office of the Supreme Leader], that all of this could lead to pressure for change that could weaken their grip on power,” says Vaez. “The supreme leader often raises the bogeyman of Western designs on Iran, but his real fear is that the population could turn against them. He’s even afraid of tourists.”

On that score, Khamenei’s probably right to worry. But Rouhani, Rafsanjani, and their allies, who hope to guide Iran on a path toward reform and gradual change, are ironically his best hope of avoiding an explosion.