TEHRAN, Iran – In a sweeping message that Iran is on the wrong side of Syria’s civil war, Egypt’s new president urged the world Thursday to support the rebels seeking to topple Bashar Assad and suggested that Tehran could risk a deepening confrontation with regional powers over the fate of the regime in Damascus.

The stinging comments by President Mohammed Morsi — making his first visit to Iran by an Egyptian leader since the 1979 Islamic Revolution — was another blindside blow for Iran as host of an international gathering of so-called nonaligned nations.

His speech, delivered while seated next to Iranian President Mahmoud Ahmadinejad, prompted Syria’s delegation to walk out of the gathering.

Iran’s leaders have claimed that the weeklong meeting, which wraps up Friday, displayed the futility of Western attempts to isolate the country over its nuclear program.

But Iran also was forced to endure criticism from Morsi and another high-profile guest, U.N. Secretary-General Ban Ki-moon, who cited concerns about Iran’s human rights record and called its condemnations of Israel unacceptable.

It’s highly unlikely that Iran would abandon Assad as long as there is a chance for him to hang on. Iran counts on Syria as a strategic outlet to the Mediterranean and a conduit to its anti-Israeli proxy Hezbollah in Lebanon.

But the meeting highlighted how much Iran is out of step with the rest of the region over Syria.

“The bloodshed in Syria is the responsibility of all of us and will not stop until there is real intervention to stop it. The Syrian crisis is bleeding our hearts,” Morsi told delegates at the 120-nation Nonaligned Movement.