For decades, Iran’s leaders could point to high voter turnouts in their elections as proof of the legitimacy of the Islamic Republic’s political system. But as voter turnout has plummeted in recent years, the election they will be now obliged to hold after the death of President Ebrahim Raisi will force the political establishment into a decision it does not want to make.

Ayatollah Ali Khamenei, the country’s supreme leader, has two options, each carrying risks.

He could ensure that the presidential elections, which the Constitution mandates must happen within 50 days after Mr. Raisi’s death, are open to all, from hard-liners to reformists. But that risks a competitive election that could take the country in a direction he does not want.

Or he can repeat his strategy of recent elections, and block not only reformist rivals but even moderate, loyal opposition figures. That choice might leave him facing the embarrassment of even lower voter turnout, a move that would be interpreted as a stinging rebuke of his increasingly authoritarian state.

Voter turnout in Iran has been on a downward trajectory in the last several years. In 2016, more than 60 percent of the country’s voters participated in parliamentary elections. By 2020, the figure was 42 percent. Officials had vowed that the result this March would be higher — instead it came in at just below 41 percent.

Just a week before Mr. Raisi’s death, the final round of parliamentary elections in Tehran garnered only 8 percent of potential votes — a stunning number in a country where Mr. Khamenei once mocked Western democracies for voter turnout of 30 percent to 40 percent.

“Khamenei has been presented with a golden opportunity to easily, in a face-saving way, allow people to enter the political process — if he chooses to seize this chance,” said Mohammad Ali Shabani, an Iranian political analyst and editor of Amwaj, an independent news media outlet. “Unfortunately, what has happened in the last few years indicates he will not take that route.”