Though Hassan Rouhani’s reelection on May 19 was no surprise—all previous Iranian presidents have won second terms—his relatively thin margin of victory reaffirmed predictions that his electoral base was shrinking. Despite this slump, which can partly be attributed to a sluggish economy, key reformists and moderates realized a sweeping victory in concurrent municipal elections. This victory could provide the needed political support for Rouhani’s reformist agenda.

The incumbent president received 57.1 percent of the votes in the latest presidential elections, marking a significant fall compared to the 76.9 percent the reformist Mohammed Khatami won in 2001 and a relatively small decline compared to Mahmoud Ahmadinejad’s official tally of 62.5 percent of the votes in 2009. Despite the historical accomplishment that President Rouhani’s administration had made in striking the nuclear accord with world powers in July 2015, Iran’s sluggish macroeconomic recovery under his presidency may have played a crucial role in eroding his electoral base.

Although oil production and exports rebounded after the sanctions were lifted, economic growth did not improve the living conditions of a large segment of Iranian citizens, in part because the government tightened its fiscal spending in an attempt to curb inflation. As a consequence of decreased spending and weak credit, unemployment rose under Rouhani’s first term from 10.4 percent in his first year to 12.4 percent in the last financial year. Unemployment among youth aged 15 to 29 increased from 21.2 percent in Rouhani’s first year to 25.9 percent in the last financial year.

Like unemployment, poverty rose during Rouhani’s first term as president. As oil prices dropped, the Iranian government increased energy prices by 50 percent to reduce its fiscal burdens, most heavily affecting the poor. Moreover, to lessen the government’s fiscal burden, in April 2016 the Iranian parliament approved cutting the lists of cash transfer recipients by 30 percent, removing 24 million citizens deemed least needy. Since the Ahmadinejad administration introduced its cash subsidies scheme in late 2010, many lower-income Iranian citizens became highly reliant on them. While cutting cash subsidies, albeit gradually, might improve economic efficiency in the long term, it has had a negative impact on consumer confidence. Instead of a rebound in spending, latest government statistics show that household savings are increasing, reflecting a continuing sense of economic insecurity among consumers.

Though economic issues are always a significant factor in Iranian elections, demographic changes brought them more to the center stage than before. Iran’s population is gradually aging, and the percentage of youth voters is falling relative to middle-age voters, who are more likely to prioritize economic performance over sociocultural issues. However, Iran’s young population will mostly remain supportive of the social agenda of reform-minded and centrist candidates—and increasing cultural openness in Iran means sociocultural concerns will still influence voters’ choices.

The country’s changing demographics do not seem to impact the voting behavior of ethnic minorities, who constitute roughly 40 percent of the country’s population. Although some of these provinces can swing election results, and while the appeal of populism in provinces inhabited by ethnic minorities may vary according to their level of marginalization, they generally support reformist and centrist candidates.

In provinces largely inhabited by ethnic minorities, Rouhani received his highest voting margins even though unemployment rates in these provinces were above average, suggesting their economic conditions played little role in how they voted. For example, in the Kurdish provinces of Kurdistan and Kermanshah, Rouhani received 75.1 and 69.0 percent of the votes, where the unemployment rates averaged 15.2 and 22.0 percent, respectively, at the time of his reelection. In the largely Sunni Sistan and Baluchestan province, which is inhabited by ethnic Baluchis, Rouhani received 73.6 of the votes—similar to what he achieved in 2013—despite high poverty rates and an average unemployment rate there of 12.9 percent. In Gilan province, which has a significant non-Persian ethnic population, Rouhani actually saw a significant increase in votes: 70.2 percent in 2017 compared to 58.6 percent in 2013.

However, Rouhani was not able to compete in conservative strongholds in the country’s northeastern provinces, as expected. Ebrahim Raisi—Rouhani’s main rival, who won 38 percent of the votes—leveraged economic frustration to gain populist appeal in provinces that lean conservative and might have swung toward Rouhani. In many such provinces, Raisi earned double (and even triple in places like Hamdan) the percentage of votes that Rouhani’s main conservative rivals had won in the 2013 presidential elections. Though this is partly because there were fewer conservative candidates this year, his pledges to pay triple the amount of cash handouts that Iranian citizens currently receive may have tempted many previous Rouhani supporters who had become frustrated by economic conditions to join the conservatives in voting for Raisi.

In spite of Rouhani’s comparatively weak performance for an incumbent in the presidential elections, the results of the concurrently held municipal elections countrywide reflect the complicated sociopolitical dynamics of the country. Reformists and centrists, who mostly support Rouhani, won municipal council seats in Iran’s key cities, including Tehran and Mashhad, which conservatives had controlled for the last four years. Control of key local councils like Tehran may also improve the chances of nominating reformists and centrists to run in the 2021 presidential elections, as the recent mayors of Tehran—Mahmoud Ahmadinejad and Mohammed Bagher Ghalibaf—have gone on to become the leading conservative candidates in each presidential election since 2005.

Reformists and centrists now control the presidency, key municipalities, and have a powerful constituency in the parliament, potentially providing Rouhani with additional institutional support to push for economic reforms in the country. Control of key municipalities could provide the genuine private sector more opportunities to participate in urban and rural infrastructure projects in place of the quasi-private firms linked to the Islamic Revolutionary Guard Corps (IRGC). However, increased U.S. hostility toward Iran will likely offset efforts to implement reforms, as it gives conservative powers like the IRGC more solid ground to resist market liberalization measures that could lead to larger Western presence in the country.

Tamer Badawi is a research fellow at the Istanbul-based Al-Sharq Forum, specializing in the political economy of the Middle East with a focus on Iran. Follow him on Twitter @TamerBadawi1.