President Obama told more than 130 foreign leaders Tuesday that the U.S. "will never retreat from the world" even as he faces growing Republican criticism that he has weakened America's military and its standing on the world stage.

"We will bring justice to those who harm our citizens and our friends, and we will stand with our allies," Obama told the United Nations General Assembly in New York. "America stands ready to work with all who are willing to embrace a better future."

But Obama continued to resist calls from Israeli Prime Minister Benjamin Netanyahu and Republicans that he take a harder line against Iran for its efforts to develop nuclear capabilities. Instead, Obama repeated his earlier warning to Iran: that time is running out to resolve the issue diplomatically.

"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," he said. "But that time is not unlimited."

Obama condemned the inflammatory anti-Muslim video that helped ignite violent protests across the Middle East, calling it "crude" and "disgusting" even as he defended freedom of speech laws even for such offensive expressions.

"[A]s 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 always defend their right to do so," he said, drawing laughter and applause.

Obama urged the U.N. not to be deterred by the recent spate of violence in the Middle East, which left four Americans, including Ambassador Christopher Stevens, dead, and is now threatening to undermine the progress of the so-called Arab Spring.

"The turmoil of recent weeks reminds us that the path to democracy does not end with the casting of a ballot," he said. "In other words, true democracy -- real freedom -- is hard work."

Republicans have charged that the attacks in Libya and unrest in other parts of the Middle East and Northern Africa are evidence of Obama's failed leadership as commander in chief. And Republican presidential nominee Mitt Romney, appearing Tuesday at former President Bill Clinton's Global Initiative just a short distance from the United Nations, promised to take a much stronger stance against Iran and other threats to the U.S. if elected.

"Many Americans are troubled by the developments in the Middle East," Romney said. "Syria has witnessed the killing of tens of thousands of people. The president of Egypt is a member of the Muslim Brotherhood. Our ambassador to Libya was assassinated in a terrorist attack. And Iran is moving toward nuclear weapons capability. We feel that we are at the mercy of events, rather than shaping events."

Romney outlined plans to revamp America's foreign aid programs, proposing a policy based on free enterprise that rewards U.S. companies making investments in developing countries.

Obama, by contrast, avoided any discussion of specific policy proposals and instead remained focused on what he sees as the broad moral imperative for the U.N. to support burgeoning democracies.