Iran's President Hassan Rouhani addresses a plenary meeting of the United Nations Sustainable Development Summit 2015 at the United Nations headquarters in Manhattan, New York Thomson Reuters Iranian President Hassan Rouhani said on Monday that Tehran was ready to help bring democracy to war-torn Syria and Yemen, and blamed the spread of terrorism in the Middle East on the United States.

In a speech to the annual United Nations General Assembly in New York, Rouhani said Iran was prepared to assist in "the eradication of terrorism and in paving the way for democracy".

"As we aided the establishment of democracy in Iraq and Afghanistan, we are prepared to help bring about democracy in Syria and also Yemen," said Rouhani.

Tehran has provided military and financial support to Syrian President Bashar al-Assad in the four-year war against rebels, and supports Houthi rebels fighting for power in Yemen.

Rouhani, who has said previously that Iran would back the Syrian nation and Assad "until the end of the road," did not mention the Syrian president's name in his speech.

Anti-Assad rebels enjoy the support of Sunni Muslim power Saudi Arabia, Shi'ite-led Iran's regional rival.

U.S. President Barack Obama and his Russian counterpart, Vladimir Putin, on Monday offered different views on how to resolve the Syrian crisis. But Obama said he was willing to work with Russia and Iran to end it.

Rouhani blamed the crisis in the Middle East on what he characterized as the United States' occupation of Afghanistan and Iraq as well as what he said was Washington's support for Israel against Palestine.

"If we did not have the U.S. military invasion of Afghanistan and Iraq, and the U.S.'s unwarranted support for the inhumane actions of the Zionist regime against the oppressed nation of Palestine, today the terrorists would not have an excuse for the justification of their crimes," he said.

In this photo released by the official website of the office of the Iranian Presidency on Tuesday, June 2, 2015, Iran's President Hassan Rouhani, right, greets Syrian Parliament speaker Jihad al-Laham at the start of their meeting in Tehran, Iran. Iranian Presidency Office/AP

Rouhani praised the nuclear deal reached in July between Iran and major world powers, which will lift economic sanctions on Iran in exchange for Tehran curbing its nuclear program.

"The deal is a brilliant example of victory over war that has managed to disperse the clouds of hostility and perhaps even the specter of another war and extensive tensions from the Middle East," Rouhani said.

He criticized the "incompetence and mismanagement of those in charge" of the haj tragedy in Saudi Arabia, in which more than 700 Muslim pilgrims were killed, including many Iranians.

Rouhani is cutting his U.N. trip short, returning to Teheran later on Monday to take part in ceremonies for the return of the bodies of Iranian pilgrims killed in the tragedy.

Across the street from the United Nations complex, a crowd of demonstrators gathered to protest the state of human rights under Rouhani and the Iranian government. Reuters photographers estimated the number of protesters at between 500 and 900.