Egyptian President Mohamed Morsi has said it is an "ethical duty" to support the Syrian people against the "oppressive regime" in Damascus.
His speech at the Non-Aligned Movement (NAM) summit in Tehran on Thursday prompted a walkout by the Syrians.
"Our solidarity with the struggle of the Syrian people against an oppressive regime that has lost its legitimacy is an ethical duty as it is a political and strategic necessity," Morsi said.
"We all have to announce our full solidarity with the struggle of those seeking freedom and justice in Syria, and translate this sympathy into a clear political vision that supports a peaceful transition to a democratic system of rule that reflects the demands of the Syrian people for freedom."
His comments sparked a walkout by the Syrian delegation.
Syria's Foreign Minister Walid Muallem said Morsi's speech "incites continued bloodshed in Syria".
Al Jazeera's Imran Khan, reporting from the summit, said: "Morsi's comments have caused an unease feeling, especially for the Iranians who are close to Syria."
Morsi's visit to Iran is the first by an Egyptian leader since 1979.
NAM was established in 1961 by countries that wanted to counterbalance the dominance of the US and Soviet Union during the Cold War.
It meets once every three years but its relevance on the international stage has declined significantly since the end of the Cold War and the fall of the Soviet Union.
The crisis in Syria is on the agenda for the two-day summit, as are human rights and nuclear disarmament.
Earlier Ayatollah Ali Khamenei, Iran's supreme leader, opened the summit by attacking the "overt dictatorship" of the UN Security Council in a speech.
"The UN Security Council has an irrational, unjust and utterly undemocratic structure, and this is an overt dictatorship," he said.
Iran is in a showdown with the UN over its disputed nuclear programme, which has resulted in four sets of Security Council resolutions imposing sanctions on it for pursuing uranium enrichment.
Khamenei charged that "the control room of the world [the Security Council] is under the control of the dictatorship of some Western countries" - implying the permanent council members France, Britain and US.
State television showed Ban looking nonplussed as Khamenei delivered his speech.
The NAM has long championed a reform of the UN to take power away from the Security Council and bolster the say of the General Assembly, where its members are better represented.
Khamenei's criticism of the UN's top table followed a meeting he had with Ban on Wednesday in which the UN leader bluntly told Iran to take "concrete" steps to ease the showdown over the nuclear issue.
Khamenei also told delegates that "I insist that the Islamic Republic of Iran is never seeking nuclear weapons", calling them "a major and unforgivable sin".
But he said Iran would "never give up the right to peaceful nuclear energy".
Ban urged Iran to comply with UN resolutions, demanding it curb its nuclear activities, saying that heightened international rhetoric over the issue risked degenerating into "war".
He said Iran should build confidence in its nuclear programme by "fully complying with the relevant [UN] Security Council resolutions and thoroughly co-operating with the IAEA."
Otherwise, he cautioned, "a war of words can quickly spiral into a war of violence".
He arrived on Wednesday and met Khamenei and Mahmoud Ahmadinejad, Iran's president.
Ban has not shied from drawing attention to Iran's human-rights record, expressing "serious concerns" about them.
Source: Al Jazeera and agencies