Former Iranian President Mahmoud Ahmadinejad, center, and his close ally Hamid Baghaei flash the victory sign as they arrive at the Interior Ministry to register their candidacy on Wednesday.

Story highlights

Ahmadinejad was known for his fiery foreign policy rhetoric while president

He served two terms in office, during which he pushed forward Iran's nuclear program

CNN  — 

Iran’s conservative former President Mahmoud Ahmadinejad has registered to run in the country’s presidential elections in May, according to state media.

The news is unexpected, as Ahmadinejad was instructed last September by Iran’s Supreme Leader Ayatollah Ali Khamenei not to run.

This could set up a contest pitting Ahmadinejad, known for his hardline views, against the incumbent President Hassan Rouhani, who has pursued a more moderate path since winning the 2013 election.

On Tuesday, the first day of the five-day registration process, 126 people – including six women – registered as candidates, state news agency IRNA reported. Rouhani hasn’t yet registered, but is widely expected to do so.

Iranian President Hassan Rouhani gives a press conference in the capital Tehran on April 10, 2017.

Ahmadinejad, who was president from 2005 to 2013, registered at the Interior Ministry alongside his former senior aides Esfandiar Rahim Mashaei and Hamid Baghaei, according to Mehr news agency.

Ahmadinejad was known during his two terms in office as a hardliner who pushed forward Iran’s nuclear program despite international opposition. Tehran has always insisted it is only interested in developing nuclear energy technology and has no intention of constructing nuclear weapons.

International economic sanctions imposed on Iran over its nuclear ambitions have been eased since the negotiation of a landmark 2015 deal that limits its nuclear program.

Before his 2013 election, Rouhani stressed that one of his priorities was to help his country financially by making it less isolated and more a part of, rather than a target of, the international community. The nuclear deal was pivotal to that plan.

On the US campaign trail, Donald Trump was highly critical of the deal – negotiated by the United States and other world powers – but since becoming US President he has toned down his message.

Vetting process

Iran’s presidential election is scheduled for May 19, but campaigning starts April 28.

Ahmadinejad (left) speaks,  accompanied by former Iranian Vice President Hamid Baghaei, after registering at the Interior Ministry's election headquarters.

Once the registration process ends, the would-be candidates will be vetted by the Guardian Council, the country’s most influential clerical body. Controlled by Khamenei, it decides who is allowed to run. Mashaei, Ahmadinejad’s aide, was one of those excluded from the approved list in 2013.

Ahmadinejad, who was term-limited in 2013, joined Twitter last month, perhaps signaling his readiness to return to the public stage.

While in office he notably sparked controversy in his UN appearances, often criticizing the United States with inflammatory statements.

In 2010, he alluded to the idea that the United States government was behind the 9/11 attacks, prompting a walkout by many US allies. Then US-President Barack Obama described the claims as “inexcusable,” “offensive” and “hateful.”

CNN’s Sarah Sirgany contributed to this report.