Arab leaders from Saudi Arabia to Syria rushed Thursday to congratulate Egypt for deposing its elected Muslim Brotherhood president, signaling a rare moment of unity in the divided and still overwhelmingly undemocratic region.

The enthusiastic response to the Egyptian military’s ouster of President Mohamed Morsi underscored the extent to which the Islamist leader had failed to win allies abroad, much as he had at home, alienating Egypt’s traditional friends and foes alike with an often erratic foreign policy.

It also served as a reminder that most Middle Eastern leaders remain unelected, despite the upheavals since 2011 that have spawned new democracies in three of the Arab world’s 26 countries. In many of those nations where autocrats still rule, the Muslim Brotherhood poses the most potent challenge.

The region’s traditional Sunni Muslim monarchies made no attempt to hide their relief at Morsi’s ouster.

Saudi Arabia, which historically had close relations with Egypt but not with Morsi, hailed the “wisdom and moderation” of the Egyptian military for acting to remove him.

Main players in the Egypt crisis

By doing so, the army “managed to save Egypt at this critical moment from a dark tunnel,” said a statement by King Abdullah.

Jordan lavished praise on the Egyptian people, saying that their “resolve has left the whole world amazed,” according to Foreign Minister Nasser Judeh. Young Egyptians in particular had brought “intellectual and moral credit to the Arab nation,” he said.

The United Arab Emirates, embroiled in a dispute with Morsi over its own crackdown against the Brotherhood, noted “with satisfaction” the developments in Egypt, a Foreign Ministry statement said.

Even Qatar, which had alienated its neighbors by cultivating ties with the Brotherhood regionwide, also offered warm congratulations to Egypt’s army, signaling a break with the past on the part of its new emir, Sheik Tamim bin Hamad al-Thani, who inherited power from his father last week.

The acclamations put Sunni powers on a par with the leader they are trying to topple, Syrian President Bashar al-Assad, who gloated at the Brotherhood’s failures in an interview Wednesday.

“The Muslim Brotherhood's experiment fell quickly because it is wrong, and what is built on a wrong principle will definitely fall,” said Assad, who has cast his country’s civil war as a battle between secularists and Islamists.

Only in Tunisia, the birthplace of the Arab Spring uprisings two years ago, did the elected, Brotherhood-affiliated government condemn Morsi’s ouster, calling it a “flagrant coup.” Non-Arab Turkey, whose Islamist government has a history of strained relations with the country’s own military, also warned about the implications for the future of democracy in Egypt.

Military rule in Egypt

Much of the relief elsewhere was rooted in anxieties about the challenge posed by local Brotherhood affiliates. But Morsi had won few friends with a foreign policy that zigzagged from an attempt to mend Egypt’s historically poisonous relationship with Shiite Iran to an endorsement of jihad against Shiite “infidels” in Syria.

That policy switch, announced last month, may have sealed his fate by sending signals to the Western-backed military that he was becoming more radical in ways that could entangle Egypt in the region’s brewing sectarian conflict, said Emile Hokayem, a Bahrain-based analyst with the International Institute for Strategic Studies.

“It was an incredibly foolish mistake by Morsi,” he said. “He supports a rapprochement with Iran, then veers 180 degrees in the other direction and goes for jihad in Syria.”

Israel’s government remained conspicuously quiet about Egypt on Thursday, with analysts saying Israel’s chief concern was that its neighbor does not become dangerously destabilized.

Israel will also want to be sure that any leader who replaces Morsi will uphold the two countries’ peace treaty, as Morsi had done, said Elie Podeh, a professor of Islamic and Middle Eastern Studies at the Hebrew University of Jerusalem.

“Despite all the fears, Morsi was not so bad for Israel,” he said. “From what I understand, security coordination [between Israel and Egypt] was no less good than with [former leader Hosni] Mubarak, even though there were no diplomatic relations.”

The Palestinian militant group Hamas, which runs the Gaza Strip and faces increasing isolation in the region, insisted in a statement that Morsi’s downfall would have little impact in the enclave.

Eglash reported from Jerusalem. Ahmed Ramadan in Beirut contributed to this report.