Iranians chant slogans in support of supreme leader Ayatollah Ali Khamenei, and the presidential candidate Saeed Jalili, shown in the posters, after the Friday prayer in Tehran on May 31. (Ebrahim Noroozi/AP)

Iran’s supreme leader, Ayatollah Ali Khamenei, accused foreign and domestic critics Tuesday of attempting to undermine the country’s June 14 presidential election.

“A vote for any of these eight candidates is a vote for the Islamic republic and a vote of confidence in the system and our electoral process,” Khamenei said in a sweeping speech, referring to the eight men declared eligible by Iran’s Guardian Council. He denounced critics inside and outside Iran who say the election is “engineered” or “illegitimate” because only perceived loyalists of the ruling establishment have been permitted to run.

Khamenei also rejected the idea that compromises on the international stage would ease Iran’s challenges.

“Those with the mistaken interpretation that making concessions to our enemies will ease their anger against us, in practice, prefer the enemies’ interests to our national ones,” he said.

Khamenei delivered his address at the shrine of the founder of the Islamic republic, Ayatollah Ruhollah Khomeini, during a ceremony to commemorate the anniversary of the leader’s death. The crowd was estimated to be in the tens of thousands.

In the speech, which lasted more than an hour and was broadcast live on state television, Khamenei spoke about the economic woes caused by international sanctions on Iran over its nuclear activities, among other issues.

“Yes, we have economic problems, yes, we have inflation, but, God willing, the person who comes can provide a solution to these problems. This is the wish of the Iranian people,” he said.

Khamenei also cautioned the presidential candidates against repeating some of the mistakes of the man they are attempting to succeed, President Mahmoud Ahmadinejad, whose policies have been blamed, along with the mounting sanctions, for Iran’s sagging economy.

“Candidates shouldn’t make impossible promises. Speak in a way that if next year at this time you listen to a recording of yourself, or people do, you won’t be ashamed,” Khamenei said, in an apparent reference to Ahmadinejad. “Make promises that you can deliver on so that afterward you don’t say that ‘they didn’t let me do this’ or ‘didn’t let me do that.’ ”

Iran’s political elite, including Ahmadinejad and the man he hoped would be his successor, Esfandiar Rahim Mashaei, were in attendance. Ahmadinejad sat alongside his main political rival, Sadegh Larijani, who heads Iran’s judiciary. Seated with them was former president Ali Akbar Hashemi Rafsanjani.

Rafsanjani and Mashaei registered last month to run in the election, but they were blocked by the 12-member Guardian Council, which vets presidential candidates. Their rejection by the council has led to questions about the qualifications required for becoming president of Iran.

Khamenei dismissed those criticisms as misguided plots to undermine Iran’s political system.