U.S. President Barack Obama told world leaders at the opening of the UN General Assembly in New York that an anti-Muslim video that has sparked unrest is "an insult not only to Muslims, but to America as well."

But Obama rejected the widespread violence spawned by the video.

"On this we must agree: there is no speech that justifies mindless violence. There are no words that excuse the killing of innocents. There is no video that justifies an attack on an embassy. There is no slander that provides an excuse for people to burn a restaurant in Lebanon, or destroy a school in Tunis, or cause death and destruction in Pakistan."

Obama began his remarks with a tribute to U.S. Ambassador Chris Stevens, who was killed on Sept. 11 with three other Americans in an attack on the U.S. Consulate in Benghazi, Libya.

"The attacks of the last two weeks are not simply an assault on America. They are also an assault on the very ideals upon which the United Nations was founded — the notion that people can resolve their differences peacefully; that diplomacy can take the place of war; and that in an interdependent world, all of us have a stake in working towards greater opportunity and security for our citizens."

Obama noted the challenges accompanying the transition to democracy in a country such as Libya.

"And yet the turmoil of recent weeks reminds us that the path to democracy does not end with the casting of a ballot. Nelson Mandela once said: ‘To be free is not merely to cast off one's chains, but to live in a way that respects and enhances the freedom of others.'"

Freedom of speech is enshrined in the U.S. Constitution, Obama noted. "Like me, the majority of Americans are Christian, and yet we do not ban blasphemy against our most sacred beliefs.

"As president of our country, and commander-in-chief of our military, I accept that people are going to call me awful things every day, and I will defend their right to do so," Obama said, drawing laughter and applause.

In his speech, Obama had stern words for Iran, which he said "continues to prop up a dictator in Damascus and support terrorist groups abroad. Time and again, it has failed to take the opportunity to demonstrate that its nuclear program is peaceful, and to meet its obligations to the United Nations.

"Let me be clear: America wants to resolve this issue through diplomacy, and we believe that there is still time and space to do so. But that time is not unlimited .… And that is why the United States will do what we must to prevent Iran from obtaining a nuclear weapon."

mi-iran-president-300-rtr38

Iran's President Mahmoud Ahmadinejad flashes the peace sign during the high-level meeting of the General Assembly on the rule of law at the UN headquarters in New York on Monday. (Eduardo Munoz/Reuters)

Obama denounced Syrian dictator Bashar al-Assad. "The future must not belong to a dictator who massacres his people. If there is a cause that cries out for protest in the world today, it is a regime that tortures children and shoots rockets at apartment buildings. And we must remain engaged to assure that what began with citizens demanding their rights does not end in a cycle of sectarian violence."

Obama also called for "a secure, Jewish state of Israel; and an independent, prosperous Palestine. Understanding that such a peace must come through a just agreement between the parties, America will walk alongside all who are prepared to make that journey."

UN leader sounds alarm

UN Secretary General Ban Ki-moon told world leaders in New York at the opening of the General Assembly today that he was there to "sound the alarm about our direction as a human family."

In his annual state of the world speech in New York City, Ban pointed to "widespread insecurity and injustice, inequality and intolerance."

mi-ban-ki-moon-220-rtr38e0p

Secretary General Ban Ki-moon speaks during the 67th UN General Assembly in New York on Tuesday. (Mike Segar/Reuters)

Ban noted that governments are wasting resources on deadly weapons instead of helping their people, and that too many people were "wilfully blind to the threat" of climate change.

The crisis in Syria grows worse by the day, Ban said, and is now "a regional calamity with global ramification."

Ban called for members of the Security Council to support the efforts of Joint Special Representative Lakhdar Brahimi.

"We must stop the violence and flows of arms to both sides, and set in motion a Syrian-led transition as soon as possible."

Ban also expressed "profound concern" at violence in Afghanistan and Congo, unrest in Africa's Sahel region, the dangerous Israeli-Palestinian impasse and "shrill war talk" from Israel regarding Iran’s nuclear ambitions.

Ban said Palestinians "must be able to realize their right to a viable state of their own," while "Israel must be able to live in peace and security, free from threats and rockets.

"The two-state solution is the only sustainable option. Yet the door may be closing, for good. The continued growth of Israeli settlements in the occupied Palestinian territory seriously undermines efforts toward peace. We must break this dangerous impasse."

Harper to meet with Netanyahu

Egyptian President Mohammed Morsi, an Islamist who was sworn in on June 30 after the first democratic elections in the country's modern history, will be addressing the 193-member assembly for the first time on Wednesday.

Palestinian leader Mahmoud Abbas is expected to come to the General Assembly on Thursday with a proposal to upgrade the Palestinian Authority's current status as a UN observer to a non-member observer state — but likely putting off the date for submission of a resolution to the assembly, where there are no vetoes, until after the U.S. presidential election in November.

Prime Minister Stephen Harper is in New York during the General Assembly meeting, but has declined to speak at the UN. He will have a private meeting with Israeli Prime Minister Benjamin Netanyahu and also accept an award for statesman of the year from a private foundation.

With files from The Associated Press