* Ahmadinejad tells rivals their plans will come to nothing
* Hardline cleric says Mousavi should be tried
* Police say 50 protesters arrested on Thursday
By Parisa Hafezi
TEHRAN, July 31 (Reuters) - Iran’s hardline President Mahmoud Ahmadinejad warned his political rivals on Friday that their efforts to drive a wedge between him and Supreme Leader Ayatollah Ali Khamenei would come to nothing.
Iran’s disputed presidential poll on June 12 plunged the country, the world’s fifth biggest oil exporter, into its biggest internal crisis since the 1979 Islamic revolution and exposed deep divisions in its ruling elite.
Added to the widespread popular unrest and the wrath of reformists over the disputed election, Ahmadinejad has come under fire from his own allies and lost two hardline cabinet members by defying Khamenei over his choice of vice president.
But Ahmadinejad denied any rifts among the leaders.
"This is not a political relationship ... our relationship is based on kindness. It is like a relationship between a father and his son," Ahmadinejad said in a speech in the holy Shi’ite city of Mashhad.
"Your efforts will bear no fruit. This road is closed for those devils who dream about harming our relationship. Their dream will be buried along with them," state television reported.
Khamenei, who endorsed the election result and sided openly with Ahmadinejad, reacted firmly when the president named Esfandiar Rahim-Mashaie as his deputy.
In an Islamic system in which the Supreme Leader’s word is supposed to be final and obeyed, Ahmadinejad ignored Khamenei’s order for a week.
In the past few days, some hardline backers of the president and conservative media have made unusually blunt comment on the affair, saying Ahmadinejad has challenged the authority of Khamenei, Iran’s most powerful figure.
Hardline cleric Ahmad Jannati, head of Iran’s top legislative body, also criticised Ahmadinejad.
"Such appointments hurt your supporters ... A key position should not be given to a person who is not respected," Jannati told worshippers at Tehran University. His speech was broadcast live on state radio.
The disarray in the hardline camp is likely to complicate his job of forming a new cabinet. Jannati urged the parliament to help Ahmadinejad over the new cabinet.
Jannati said the vote was Iran’s "healthiest" since the revolution, adding Iran’s moderate defeated candidate Mirhossein Mousavi should go on trial for fomenting instability in Iran.
Mousavi and other leading moderates say the vote was rigged, calling the new government "illegitimate".
"You were behind these unrests. You are responsible for the bloodshed," Jannati said. "Sooner or later you will be punished for your illegal and un-Islamic acts."
Iranian media have reported the deaths of 20 protesters since the vote. Mousavi blames the authorities for killing of his supporters, saying he would not allow their "blood to be trampled".
Rights groups say hundreds of people, including senior pro-reform politicians, journalists and lawyers, have been detained since June. Reformers demand their immediate release.
"We can not demand release of those criminals who have damaged public properties, created disorder and instability," Jannati said. "But others should be freed."
Some prominent reformists had been detained for acting against national security, a common charge against dissenting voices in Iran. They could even face the death penalty.
In a show of defiance on Thursday thousands of pro-reformers mourned Neda Agha-Soltan’s killing in post-election unrests. Iranian riot police fired tear gas and arrested protesters.
A police official told the semi-official ILNA news agency on Friday that 50 protesters had been arrested at the unrest but "many of them have been released later".
Reformist former President Mohammad Khatami again denounced the killings and arrests on Friday, saying reformers will continue their path, ILNA reported.
(Editing by Samia Nakhoul)