Does anyone remember Mahmoud Ahmadinejad? Until recently, the Islamic radical and former military officer who served as Iran’s sixth president could be considered something of a political footnote.

During his two terms in office (2005–09 and 2009–13), Ahmadinejad’s anti-Western bombast and political brinkmanship helped transform Iran into an international pariah, while his ruinous economic policies exacerbated the country’s mounting fiscal woes. By the end of his tenure, Ahmadinejad was deeply unpopular at home, roundly blamed for a major decline in both domestic prosperity and global standing. He had also fallen out with his one-time protector, Supreme Leader Ali Khamenei, leaving him all but politically neutered.

Now, however, the firebrand former president appears to be making a comeback. In recent weeks, Ahmadinejad has reemerged on the national scene, touring the Iranian countryside and giving public lectures criticizing the administration of his successor, Hassan Rouhani. He even briefly captured the international spotlight in recent days by penning an open letter to President Obama, calling on him to release some $2 billion in seized assets as a gesture of goodwill.

The results have been notable. A July 2016 survey of Iranian popular opinion carried out by the Center for International and Security Studies at the University of Maryland found that Ahmadinejad now represents the single largest threat to Rouhani’s reelection, and trails the once-popular incumbent by only eight points. Suddenly, the ex-president seems once again to be a real political contender.

Ahmadinejad’s return is at least partially driven by personal agenda. Initially, his retirement plans centered on the creation of a new technical university in Tehran, and he even received a license to open one as a parting gift from Iran’s clerical leadership. The transition to academic life, however, wasn’t a smooth one. Although the former president quickly assumed a professorship at Tehran’s University of Science and Technology, his larger plans for a new institute of his own have fizzled, hampered by a lack of funding. Over time, this appears to have nudged Ahmadinejad into giving national office a second look.

But the new push is also politically opportunistic. Iran’s former president understands full well that Hassan Rouhani’s signature initiative, the nuclear deal between Iran and the P5+1 powers, concluded last year, is highly controversial within the Islamic Republic. Iran’s hard-liners remain deeply skeptical of the agreement, and leery of its potential implications for their grip on power.

They aren’t the only ones. Increasingly, the Iranian public—once broadly supportive of a nuclear rapprochement with the West—has begun to sour on the idea as well. The same July 2016 study found “declining enthusiasm” for the year-old agreement, with the number of respondents who approve or strongly approve of the deal declining from 76 to 63 percent—largely because most ordinary Iranians have yet to see any tangible economic dividends (even if the country’s powerful clerical army, the Revolutionary Guard, has).

Iran’s leaders are keenly aware of this mounting frustration, and have begun to distance themselves from the deal. Supreme Leader Ali Khamenei, for example, used the occasion of an August 1 speech in Tehran to cast doubt on the prudence of the agreement he once endorsed. “Weren’t the oppressive sanctions lifted so that the people would feel a change in their lives?” he chided publicly. The message was unmistakable: on both a political and an economic level, the nuclear deal has failed to deliver.

For Ahmadinejad, whose time in office was defined by hostility toward the West, this turn of events provides a concrete opening. Even so, Ahmadinejad’s political return isn’t inevitable, or even likely. As president, Ahmadinejad engendered more than his fair share of elite opposition, and that hostility has endured—with key clerical leaders signaling their continued displeasure in recent days.

Nevertheless, in crafting his comeback, Ahmadinejad is clearly betting on the fact that a significant part of the Iranian electorate believes that, nuclear deal or no, Tehran and Washington remain fundamentally at odds. The outcome of next year’s presidential election in Iran will determine whether or not he has wagered correctly.

Ilan Berman is Vice President of the American Foreign Policy Council in Washington, DC.

Image: Mahmoud Ahmadinejad, former president of Iran. Wikimedia Commons/Hamed Amirnejad.