TEHRAN, Iran - Iranian President Mahmoud Ahmadinejad caved in to pressure from hard-line clerics and the country's supreme leader yesterday and allowed the resignation of his top deputy after a weeklong standoff.

For days, the president had resisted pressure from hard-liners, including a direct order from Iran's supreme leader, Ayatollah Ali Khamenei, to dismiss his choice for the key post of first vice president, Esfandiar Rahim Mashai, who last year angered conservatives when he made friendly comments toward Israel.

The final blow appeared to be the public reading on state television of the order issued earlier by Khamenei to dismiss Mashai because he is "contrary to the interest of you and the government."

The issue created a rare rift between Ahmadinejad and the hard-liners who form the bedrock of his support and comes at a sensitive time as he is battling opposition reformists who accuse him of winning the June 12 presidential elections through fraud.

"After the announcement of the exalted supreme leader's order, Mashai doesn't consider himself first vice president," IRNA quoted presidential aide Mojtaba Samareh Hashemi as saying late yesterday.

The resignation capped a day of renewed pressure that featured conservative student street demonstrations and Friday sermons railing against Mashai's appointment.

Despite all the pressure, Ahmadinejad had pleaded for more time to explain his reasons for choosing a man he had described as a "pious, caring, honest, and creative caretaker for Iran." Mashai's son is also married to the president's daughter.

The president even continued to back his man after his greatest supporter and the supreme leader of the country issued a private order Monday telling him that the appointment "causes a rift and disillusionment among your supporters. The aforementioned appointment must be canceled and consider it null and void."

Yesterday's public reading of the order dramatically increased the pressure on Ahmadinejad, and further refusal to act would have amounted to a flagrant and public defiance of the supreme leader.

The issue was also the topic of the main Friday prayer sermon in Tehran. Ayatollah Ahmad Khatami said that "now that he [Khamenei] has expressed his opinion, there is no room for delay anymore."

Khamenei has the final say over all state matters and has rarely faced defiance in the past. That changed after last month's election when supporters of opposition leader Mir Hossein Mousavi challenged Khamenei's ruling that the June 12 vote was fair.

By demanding Mashai's removal, Khamenei is effectively appropriating a new power, since normally the supreme leader does not intervene openly to oust a government official, though he is believed to vet appointments behind the scenes.