Iran's Supreme Leader Ayatollah Ali Khamenei has criticised President Hassan Rouhani for saying his detente policy with the West had caused the threat of war to fade, as tensions intensify in Tehran before May's presidential election.

Rouhani, whose election in 2013 led to a diplomatic thaw between Iran and the West, championed in 2015 a landmark deal in which Tehran agreed to curb its nuclear activities in return for lifting of international sanctions.

A standoff between Rouhani, who is seeking a second term, and Khamenei's allies, who opposed the nuclear deal, has intensified in recent months ahead of the 19 May vote.

"Some say since we took office the shadow of war has been faded away. This is not correct," Khamenei was quoted as saying by the state media on Sunday.

"It's been people's presence in the political scene that has removed the shadow of war from the country," he added.

Rouhani faces competition from hardliners who have criticised his economic record, saying detente with the West and nuclear concessions had yet to yield economic benefits.

He urged voters on Saturday to prevent "extremism" returning to Iran, saying the country could face greater authoritarianism if he was replaced by a hardline rival.

Among Rouhani's challengers are Ebrahim Raisi, an influential cleric with decades of experience in the hardline judiciary, and conservative Tehran Mayor Mohammad Bagher Ghalibaf, a former Revolutionary Guards commander.

The six candidates standing in Iran's presidential election squared off in their first live television debate on Friday, with Rouhani coming under fire.

Televised debates, while a relatively new feature of Iranian presidential elections, are believed to have influenced voting results in 2009 and 2013.

Ahead of the 19 May poll, the interior ministry announced a ban on live television debates, triggering an outcry that prompted a reversal of its decision. Three live debates are now expected.

Rouhani, who is hoping for a second term in office, conservative rivals Raisi and Ghalibaf all rejected the ban.

Iran's presidential election was also hit with controversy when former Iranian leader Mahmoud Ahmadinejad, who ruled Iran from 2005 to 2013, was barred from running.

Khamenei had advised Ahmadinejad not to run, and his attempt to become a candidate was widely seen as a public snub to the ayatollah, which is almost unheard of in the Islamic Republic.

On Friday, during the first live debate, Ghalibaf hammered Rouhani and his confidante and first vice-president, Eshaq Jahangiri, with both sides trading accusations of "lies" and making "insincere" comments.

Ghalibaf berated Rouhani for failing to make good on a promise "to create four million jobs," saying unemployment was Iran's "biggest problem".

Rouhani riposted by saying: "I never promised to create four million jobs. That's a lie."

Unemployment, which stands at 12.4 percent, and the lack of housing and government aid for the underprivileged were the issues that dominated Friday's debate.