TEHRAN – Iranian President Mahmoud Ahmadinejad has come under fire from leading hardliners for naming as his top deputy a man who said Iran was friends with everyone, including arch-foe Israel, local media said on Sunday.

Iran's state-run English language Press TV said Esfandiar Rahim Mashaie no longer wanted the job of first vice president and had resigned because of the row.

There was no immediate confirmation of the decision.

Analysts say Thursday's decision by Ahmadinejad to appoint Mashaie, to whom he is related by marriage, suggests that the president has a small entourage of people he trusts.

Ahmadinejad was re-elected in a June 12 presidential vote, which stirred the largest display of internal unrest in Iran, the world's fifth biggest oil exporter, since the 1979 islamic revolution and exposed deep rifts in its ruling elite.

Iran, which has accused Western countries of fomenting the unrest, on Sunday released a local British embassy employee, Hossein Rassam, on $100,000 bail, his lawyer said.

Rassam was the last employee still in detention of nine Iranian British embassy staff held late last month for alleged involvement in mass street protests following the election.

Defeated pro-reform candidates say the vote was rigged, but the latest criticism of Ahmadinejad came from conservatives.

In rare public criticism, Ayatollah Ahmad Khatami, an Ahmadinejad ally and member of Iran's top legislative body, said on Sunday that Ahmadinejad had shown a twisted face to clerics and elites by appointing Mashaie last Thursday.

Ahmadinejad should not challenge conservatives with such decisions. I request the president to replace him before more criticisms are made, the hardline cleric was quoted as saying by the Khorasan newspaper.

Mashaie, whose remarks on Israel in 2008 created a storm at home, was previously one of several vice presidents and in charge of a culture and tourism body.

There are still many hardliners who back the president, such as Ayatollah Mohammad Yazdi, who said in remarks published on Saturday that the Iranian government drew its legitimacy from the Almighty God.

HARDLINE VOICES

Many hardline lawmakers and clerics, including several top clerics, had called on the president to dismiss Mashaie for his Israel comments. Ahmadinejad remained defiant, saying Mashaie's remarks had been misrepresented.

The row over Mashaie last year ended after Iran's most powerful figure Supreme Leader Ayatollah Ali Khamenei, who backs Ahmadinejad, said in September the remarks are not right but the dispute should end.

A hardline editor seen as close to Iran's top authority also criticized Ahmadinejad's choice of the first vice president, which unlike ministers does not need approval of parliament.

Ahmadinejad's appointment of Mashaie as his first vice president brought shock, regret and concern to his voters, said Hossein Shariatmadari, the editor-in-chief of the hardline Kayhan daily.

It is necessary for Ahmadinejad to take back the first vice presidency from Mashaie, Shariatmadari wrote in the daily.

Mashaie also came under fire for hosting a ceremony in November where women in traditional dress carried in Muslim's holy book, the Koran, to music, an action deemed insulting to Koran.

Lawmaker Hamid Rasai said Iranian society was very sensitive over Mashaie.

I believe it would have been better if he had not been appointed, the Etemad-e Melli newspaper quoted Rasai, an ally of Ahmadinejad, as saying.

A pro-reform lawmaker said Ahmadinejad could be impeached over his decision.

Now lawmakers can question Ahmadinejad or even impeach him for this appointment, the newspaper quoted Dariush Ghanbari as saying. Analysts say Ahmadinejad's impeachment is unlikely, as parliament is dominated by hardliners.

(Writing by Zahra Hosseinian, Editing by Mark Trevelyan)