TEHRAN — Iran on Monday denounced the military coup that toppled Egyptian President Mohamed Morsi, signaling a shift after days of guarded and cryptic commentary on the crisis.

“The interference of military forces in the political scene is unacceptable and concerning,” Foreign Ministry spokesman Abbas Araqchi said Monday, according to Iran’s English-language Press TV.

Iran has called for reinstatement of the democratically elected Morsi and said that elections, not “the streets,” should determine who is Egypt’s leader — an indication that Tehran sees an Islamist government, however flawed, as its best hope for an ally in Cairo.

The Foreign Ministry statement came after news broke that dozens of pro-Morsi demonstrators were killed in Cairo early Monday in the deadliest incident since the military removed Egypt’s first democratically elected president from power last week. Egypt’s Muslim Brotherhood, Morsi’s political base, blamed the military for Monday’s “massacre,” while the Egyptian military said “terrorists” provoked the deadly incident.

The events are being closely watched in Iran, which has sought to portray Arab uprisings in Egypt and elsewhere as part of a regional “Islamic awakening,” inspired by Iran’s 1979 Islamic Revolution.

Iran has enthusiastically backed recent Arab uprisings except for the revolt-turned-civil-war in Syria, where rebels are fighting to oust the government of Bashar Assad, a close Tehran ally.

Still, the turmoil in Egypt has posed somewhat of a dilemma for Iran, ruled by a Shiite Muslim clerical establishment. Iran’s leadership aspires to be viewed as being in the vanguard of Islamist political movements, but it has long been wary of the Sunni-dominated Muslim Brotherhood.

The Syrian civil war has escalated tensions between Islam’s Shiite and Sunni branches. In Syria, mostly Sunni rebels are fighting to oust a Tehran-backed government dominated by the minority Alawite sect, a Shiite offshoot.

Many in Iran had hoped that the ascension of an Islamist government in Cairo could usher in an era of warmer ties between two regional giants. Egypt and Iran have been at odds since 1979, when Cairo provided refuge to the deposed, U.S.-backed shah, who died in Egypt and was given a state funeral by then-President Anwar Sadat. The Iranian government later named a Tehran street after Khaled Islambouli, an Egyptian army officer who led the fundamentalist hit squad that assassinated Sadat.

The Egypt-Israel peace treaty has also been a source of discord in Tehran, an implacable foe of Israel.

Last year, Morsi became the first Egyptian leader to visit the Islamic Republic. But tensions over the two countries’ diametrically opposed stances on Syria grew as the violence in Syria inflamed religious enmities.

The Muslim Brotherhood has helped bankroll the Syrian revolt, while Iran has provided large-scale aid to Syria's secular government. As the sectarian rhetoric surrounding the Syria issue has ratcheted up in recent weeks, Iranian authorities have recoiled at what they view as anti-Shiite pronouncements emanating from Sunni-dominated Egypt and allied gulf states.

Last month’s mob killing of a Shiite cleric and three other Shiites outside Cairo sparked widespread condemnation here.

A spokesman for the Brotherhood reportedly identified the victims as “the four dead who have beliefs of their own that are alien to our society,” a comment that further stoked outrage in Iran.

Writing Monday in Iran´s influential hard-line Kayhan daily, columnist Mohammed Eimani argued that Egypt’s revolution was incomplete and lacked sound leadership, a shortcoming that he said allowed for a return of reactionary secular forces.

The column quickly created a buzz in official Iranian media and on the Web, with many comparing the Egyptian revolution unfavorably to Iran’s 1979 experience.

Some commentators seemed to suggest that what Egypt was missing was Iran’s post-revolutionary purge of perceived enemies, a bloody campaign that saw executions of former security officers, leftists and others deemed disloyal to the new religious hierarchy.

A major fault with the Egyptian revolution, argued Hossein Sheikholeslam, Iran´s former ambassador to Syria, was the fact that Egypt’s national army wasn´t disbanded and restored under a new leadership. Egypt, the ex-ambassador told state TV, lacks “pro-revolutionary mechanisms” similar to Iran´s elite Revolutionary Guard Corps or the paramilitary Basiji militia, both fiercely loyal to the ruling clerics and ready to put down any dissent viewed as threatening.

Echoing other commentators here, the Foreign Ministry spokesman, Araqchi, warned Monday against “foreign hands at work” in Egypt, a thinly veiled reference to Iran’s archenemies  the United States and Israel.

But in his sermon Friday, hard-line Ayatollah Ahmad Khatami denounced as “savage” the anti-Shiite attacks in Egypt and said that the Egyptian government’s “misconduct” led to its demise, concluding, “The Egyptian leadership has no one to blame but themselves.”

ALSO:

North, South Korea work on reopening industrial park

Key Egyptian religious party condemns bloodshed; death toll at 51

Brazil demanding answers from U.S. in wake of Edward Snowden leaks

Special correspondents Mostaghim and Sandels reported from Tehran and Beirut, respectively. Times staff writer Patrick J. McDonnell in Beirut contributed to this report.