Beirut: Iran's Supreme Leader Ayatollah Ali Khamenei warned on Wednesday that any attempts to disrupt the presidential election on May 19 would be dealt with harshly.
The vote has shaped up to be primarily a contest between incumbent president Hassan Rouhani and hardline rival Ebrahim Raisi, who served in top positions in the judiciary for years.
The election will be held as Rouhani, elected in a landslide in 2013, is coming to the end of his four-year term.
Raisi has the backing of Khamenei, according to analysts.
"If people participate with order, behave morally, observe legal and Islamic parameters then this will be a source of honour for the Islamic Republic," Khamenei said, according to the transcript of a speech published on the Supreme Leader's official website.
"But if they break the law, operate in an immoral way, or speak in a way that will encourage enemies, then the elections can be seen as a loss." Dozens of people were killed and hundreds arrested when widespread protests broke out after a disputed presidential election in 2009, which kept Mahmoud Ahmadinejad in office for a second term, according to human rights groups.
"The security of the country must be completely preserved during the election," Khamenei said in the speech, which was delivered to an audience that included top commanders from the Revolutionary Guards, the most powerful military and economic force in the country.
"Anyone who deviates from this path should certainly know that they will be given a slap."
Rouhani is standing for a second term against five other candidates, including his own vice president Ishaq Jahangiri, a moderate, and Tehran mayor Mohammad Baqer Qalibaf, a hardliner.
If nobody wins more than 50 per cent of the votes cast in the first round on May 19, there will be a run-off a week later.
Raisi has harshly criticised Rouhani's economic performance during live presidential debates in the past two weeks.
Khamenei is also unhappy with Rouhani's economic performance and said the government should have done more to tackle unemployment.
Iran has an unemployment rate of 12.7 per cent for a population of about 80 million, according to figures released by the Statistical Centre of Iran last autumn.