"I am sending you the letter of Rahim Mashaie announcing he is stepping down from the post of the vice president," Ahmadinejad said, according to IRNA.
The agency later reported that Ahmadinejad named Rahim Mashaie as his advisor and head of his office, describing him as "trusted, devoted and pious."
"I appoint you as the advisor and head of the presidential office," Ahmadinejad said in a letter carried by IRNA.
Rahim Mashaie's appointment as vice president triggered opposition from hardliners and plunged Iran into a fresh political turmoil, as it remains engulfed in the worst crisis since the 1979 Islamic revolution.
Widespread protests after the June 12 re-election of Ahmadinejad left at least 20 people dead and have shaken the pillars of the Islamic republic.
Khamenei had ordered the sacking of Rahim Mashaie, who caused a stir last year when he said Iran was a "friend of the Israeli people."
The appointment was against the best interest of Ahmadinejad and the government, and it would cause "division and frustration among your supporters," Khamenei said in a letter.
"It is necessary that the appointment be cancelled," he said according to state television.
The sacking comes as a blow to Ahmadinejad, who had defended his deputy and described him as "like a pure source of water."
Independent analyst Mohammad Saleh Sedghian told AFP that Rahim Mashaie "is one of Mr Ahmadinejad's inner circle of trustees."
"His appointment was to have total supervision of the cabinet, especially control over sensitive sectors like oil, economy and central bank...," he said.
"His appointment was aimed at having total control over the cabinet over the next four years so there would be absolutely no opposition."
Ahmadinejad's re-election has been hotly disputed by his main challenger, Mir Hossein Mousavi, who says his victory was a result of massive vote rigging.
Hundreds of thousands of Iranians poured into Tehran streets to protest their "stolen votes" before security forces launched a crackdown in which at least 20 people died and more than 1,000 were arrested.
The crisis has ricocheted all the way up the state structure, with Khamenei denouncing protesters, giving unconditional support to Ahmadinejad and declaring the poll legal.
But powerful cleric Akbar Hashemi Rafsanjani sees the Islamic regime as having lost the trust of the people, while reformists such as fellow former president Mohammad Khatami have called for a referendum to end the crisis.
Opposition leaders Mousavi, Mehdi Karroubi and Khatami on Saturday urged Iran's clerics to intervene to help stop the spread of "oppression" by the authorities.
In a statement on Mousavi's website Ghalamnews, the three accused the regime of "savagery" and said its "interrogation methods are a reminder of the dark era of the Shah" Mohammad Reza Pahlavi, who was toppled in the 1979 revolution.
Karroubi said in separate comments that "women were attacked with clubs and beaten and thrown in the gutters" during the protests.
Their latest tirade came as a young Iranian man arrested during the protests was reported by two reformist newspapers to have died in custody.
"Mohsen Ruholamini, arrested in July 9 gatherings ... was killed," Etemad newspaper reported, quoting a pro-opposition website.
Meanwhile Khamenei launched on Saturday a new call to the country's disparate groups to set aside their differences.
"Nobody should accuse the other without any reason. We should be fair in treating each other," he said, ahead of Sunday's birth anniversary of Shiite saint Imam Hossein.
Around the globe protests were held on Saturday against Ahmadinejad's government, with hundreds of people gatherings in such cities as Amsterdam, London, Stockholm and Tokyo in support of his opponents.
In Amsterdam, Iran's Nobel peace prize winner Shirin Ebadi the crowd in chanting: "We want to live in peace. Long live peace".
-------------------------------------------------------------------------------------------------------------------------------
The agency later reported that Ahmadinejad named Rahim Mashaie as his advisor and head of his office, describing him as "trusted, devoted and pious."
"I appoint you as the advisor and head of the presidential office," Ahmadinejad said in a letter carried by IRNA.
Rahim Mashaie's appointment as vice president triggered opposition from hardliners and plunged Iran into a fresh political turmoil, as it remains engulfed in the worst crisis since the 1979 Islamic revolution.
Widespread protests after the June 12 re-election of Ahmadinejad left at least 20 people dead and have shaken the pillars of the Islamic republic.
Khamenei had ordered the sacking of Rahim Mashaie, who caused a stir last year when he said Iran was a "friend of the Israeli people."
The appointment was against the best interest of Ahmadinejad and the government, and it would cause "division and frustration among your supporters," Khamenei said in a letter.
"It is necessary that the appointment be cancelled," he said according to state television.
The sacking comes as a blow to Ahmadinejad, who had defended his deputy and described him as "like a pure source of water."
Independent analyst Mohammad Saleh Sedghian told AFP that Rahim Mashaie "is one of Mr Ahmadinejad's inner circle of trustees."
"His appointment was to have total supervision of the cabinet, especially control over sensitive sectors like oil, economy and central bank...," he said.
"His appointment was aimed at having total control over the cabinet over the next four years so there would be absolutely no opposition."
Ahmadinejad's re-election has been hotly disputed by his main challenger, Mir Hossein Mousavi, who says his victory was a result of massive vote rigging.
Hundreds of thousands of Iranians poured into Tehran streets to protest their "stolen votes" before security forces launched a crackdown in which at least 20 people died and more than 1,000 were arrested.
The crisis has ricocheted all the way up the state structure, with Khamenei denouncing protesters, giving unconditional support to Ahmadinejad and declaring the poll legal.
But powerful cleric Akbar Hashemi Rafsanjani sees the Islamic regime as having lost the trust of the people, while reformists such as fellow former president Mohammad Khatami have called for a referendum to end the crisis.
Opposition leaders Mousavi, Mehdi Karroubi and Khatami on Saturday urged Iran's clerics to intervene to help stop the spread of "oppression" by the authorities.
In a statement on Mousavi's website Ghalamnews, the three accused the regime of "savagery" and said its "interrogation methods are a reminder of the dark era of the Shah" Mohammad Reza Pahlavi, who was toppled in the 1979 revolution.
Karroubi said in separate comments that "women were attacked with clubs and beaten and thrown in the gutters" during the protests.
Their latest tirade came as a young Iranian man arrested during the protests was reported by two reformist newspapers to have died in custody.
"Mohsen Ruholamini, arrested in July 9 gatherings ... was killed," Etemad newspaper reported, quoting a pro-opposition website.
Meanwhile Khamenei launched on Saturday a new call to the country's disparate groups to set aside their differences.
"Nobody should accuse the other without any reason. We should be fair in treating each other," he said, ahead of Sunday's birth anniversary of Shiite saint Imam Hossein.
Around the globe protests were held on Saturday against Ahmadinejad's government, with hundreds of people gatherings in such cities as Amsterdam, London, Stockholm and Tokyo in support of his opponents.
In Amsterdam, Iran's Nobel peace prize winner Shirin Ebadi the crowd in chanting: "We want to live in peace. Long live peace".
-------------------------------------------------------------------------------------------------------------------------------