Iranian supreme leader Ayatollah Ali Khamenei ordered his close ally President Mahmoud Ahmadinejad to dismiss his controversial choice of a top deputy for making pro-Israeli remarks, the semiofficial media reported Wednesday. The move marked a rare split among the country's top conservatives. The order is a humiliating setback for Ahmadinejad who had strongly defended his decision to appoint Esfandiar Rahim Mashai, his son's father-in-law, as his first vice president. Mashai angered hard-liners in 2008 when he said Iranians were "friends of all people in the world - even Israelis." Mashai was serving as vice president in charge of tourism and cultural heritage at the time. Iran has 12 vice presidents, but the first vice president is the most important because he leads Cabinet meetings in the absence of the president. Ahmadinejad is already in a crisis over opposition claims he stole last month's presidential election from the pro-reform candidate Mir Hossein Mousavi. Supreme leader Ayatollah Ali Khamenei strongly backed Ahmadinejad, who is seen as his protÃ©gÃ©, in that dispute. "The view of the exalted leader on the removal of Mashai from the post of vice president has been notified to Ahmadinejad in writing," the semiofficial Fars news agency reported Wednesday. It was not immediately clear if Ahmadinejad would cave in to Khamenei's order, who has the final say on all state matters in Iran. Ali Akbar Javanfekr, top media adviser to Ahmadinejad, said on Tuesday that the president won't change his mind over the controversy. "The president makes his decisions ... within the framework of his legal powers and on the basis of investigations carried out. Experience has proved that creating baseless controversies won't influence the president's decision," Javanfekr said in his blog. It was unclear if this was before or after the supreme leader's order. The deputy speaker of the parliament, Mohammad Hasan Aboutorabi-Fard, meanwhile, said that Mashai's dismissal was a decision by the ruling system itself, according to the semiofficial ISNA news. "Removing Mashai from key posts and the position of vice president is a strategic decision of the system ... Dismissal or resignation of Mashai needs to be announced by the president without any delay," ISNA quoted him as saying late Tuesday. Pressure has been mounting on Ahmadinejad to remove Mashai from the top post immediately after he appointed the controversial figure to the post Friday. But nearly the same time as Khamenei was issuing his order late Tuesday, Ahmadinejad vowed to keep Mashai as his first vice president. "Mr. Mashai is a supporter of the position of the supreme leader and a pious, caring, honest and creative caretaker for Iran ... Why should he resign?" the official IRNA news agency quoted Ahmadinejad as saying late Tuesday. "Mashai has been appointed as first vice president and continues his activities in the government." Iran's state television didn't report Ahmadinejad's comments supporting his deputy. A conservative Web site said TV officials had orders from higher officials not to do so. Mashai also angered many of Iran's top clerics in 2007 when he attended a ceremony in Turkey where women performed a traditional dance. Conservative interpretations of Islam prohibit women from dancing. He ran into trouble again in 2008 when he hosted a ceremony in Tehran in which several women played tambourines and another one carried the Quran to a podium to recite verses from the Muslim holy book. The criticism is a change of focus for hard-liners, who have spent the last few weeks lambasting Mousavi and his supporters for challenging the presidential election. On Saturday, hard-liners accused Rafsanjani of defying Khamenei by using his sermon to encourage opposition supporters to continue their protests.