On the podium yesterday at the United Nations General Assembly in New York, six weeks before the US presidential election, Mr Obama sought to counter criticism of his foreign policy from Republican rival Mitt Romney.
Mr Romney has accused him of mishandling the Arab spring uprisings, damaging ties with Israel and not being tough enough on Iran.
Mr Obama also challenged world leaders to stand united against anti-American violence that has swept Muslim countries in recent weeks and to promote tolerance amid anger over a crudely made video that offended Islam. “There are no words that excuse the killing of innocents,” he said.
Seeking to step up pressure on Iran, Mr Obama said there was still scope for diplomacy but that “time is not unlimited”.
His tough talk appeared aimed at easing Israeli fears about US resolve to curb Tehran’s nuclear ambitions, as he again insisted he would never let Iran develop an atomic bomb.
But he stopped short of meeting Israeli premier Benjamin Netanyahu’s demand to set a specific “red line” that Iran must not cross if it is to avoid military action, and did not go much farther in his rhetoric than he had previously.
“A nuclear-armed Iran is not a challenge that can be contained,” he said. “It would threaten the elimination of Israel, the security of Gulf nations and the stability of the global economy.
“The United States will do what we must to prevent Iran from obtaining a nuclear weapon.”
But in his opening comments, UN secretary-general Ban Ki-moon said: “I also reject both the language of delegitimation and threats of potential military action by one state against another. Any such attacks would be devastating.”
US officials have said that all options are on the table against Iran – code for a military strike – while Mr Netanyahu has called for a US ultimatum to Iran. But Mr Obama did not repeat that line in his speech. On Monday, Iranian president Mahmoud Ahmadinejad said Israel has no roots in the Middle East and would be “eliminated.” The White House dismissed his comments as “disgusting”.
Without naming Mr Ahmadinejad, Mr Obama yesterday said the world must “leave behind” those who deny the Holocaust or reject Israel’s right to exist. He also sought to reassure US voters that he is doing everything he can to head off any more violence like the 11 September attack in Libya that killed the US ambassador and three of his colleagues and the recent upheaval sparked by Muslim outrage over an anti-Islam video made in California.
“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,” Mr Obama said.
The crisis has exposed a deep divide over the issues of free speech and blasphemy at a time when Islamist forces are in the political ascendant in the Middle East after several veteran dictators were dethroned.
“There is no speech that justifies mindless violence,” Mr Obama said. His audience listened in polite silence but he drew laughter when he said that people say “awful things” about him every day and he accepts it.
He also had harsh words for Syrian president Bashar al-Assad, saying his regime “must come to an end,” a reminder of Mr Assad’s defiance of calls for him to end a bloody 18-month crackdown and step aside.
And Mr Obama renewed his call for Israeli-Palestinian peace talks – which he made a priority when he took office but on which he has failed to advance.