BEIRUT (Reuters) - 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.

FILE PHOTO: Iran's Supreme Leader Ayatollah Ali Khamenei speaks live on television after casting his ballot in the Iranian presidential election in Tehran June 12, 2009. REUTERS/Caren Firouz/File Photo

The vote has shaped up to be primarily a contest between incumbent president Hassan Rouhani, a pragmatist who has campaigned on a platform of opening up the country to the West and easing social restrictions, 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 honor 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.”

SECOND TERM

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 percent of the votes cast in the first round on May 19, there will be a run-off a week later.

Raisi has harshly criticized 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 percent for a population of about 80 million, according to figures released by the Statistical Centre of Iran last autumn.

Rouhani, for his part, has indirectly criticized Raisi’s time at the judiciary.

“The people of Iran will announce in (the May election) that they don’t accept those who only knew executions and prison for 38 years,” Rouhani said Monday, according to the Iranian Students’ News Agency (ISNA).