"We do not consider proper the intervention by military forces in politics to replace a democratically elected administration," said ministry spokesman Abbas Araghchi, according to the official news agency IRNA.
- Hundreds rally in Sakhnin, Kafr Kanna in support of Morsi
- Al-Sisi to Morsi: The people want you out
- Egyptians believe Morsi in cahoots with US, Israel
Egypt's military ousted Mohamed Morsi Wednesday after four days of mass protests against him.
Araghchi said that supporters of Morsi should not give up their efforts to reinstate him. Elections and not "the streets" should not decide who is president of Egypt, he said.
"Islamists and revolutionaries should not be frustrated," Araghchi said.
On the other hand, he said, "We do not see the recent events in Egypt as a defeat for Islamic awakening."
Iran has considered uprisings in Arab countries as an "Islamic awakening," repeating its own 1979 Islamic revolution that ousted the pro-Western monarchy and brought Islamists to power.
The exception to Iranian support for the uprisings is Syria, where mostly Sunni rebels are fighting to topple President Bashar Assad, who belongs to an offshoot of Shiite Islam. As the region's Shiite leader, Iran is Assad's chief ally.
Egypt has sided with most other Arab states to support Syrian rebels seeking to overthrow Assad.
Morsi established warmer relations with Iran, ending decades of diplomatic estrangement that began in 1979, when Egypt offered refuge to Iran's deposed ruler after the Islamic revolution.
Ties further deteriorated after Egypt signed a peace treaty with Israel the same year. Iran and Israel remain bitter enemies.
- Receive Ynetnews updates
directly to your desktop