UNITED NATIONS - President Barack Obama and his Iranian counterpart Mahmoud Ahmadinejad traded accusations about their nations' nuclear programs, but both left the door open to further negotiations about the nuclear impasse. In his speech Thursday to the annual summit of world leaders, Ahmadinejad also raised the possibility that "some segments within the U.S. government" had orchestrated the Sept. 11, 2001 attacks in New York , a statement that prompted members of the American delegation to walk out in protest from the U.N. General Assembly. Delegations from all 27 European Union nations followed the Americans out along with representatives from Australia, New Zealand, Canada and Costa Rica, an EU diplomat said. Mark Kornblau, spokesman for the U.S. Mission to the world body, issued a statement after the U.S. walkout, saying that Ahmadinejad "has yet again chosen to spout vile conspiracy theories and anti-Semitic slurs that are as abhorrent and delusional as they are predictable." Iran is expected to remain high on the agenda of the General Assembly's annual ministerial meeting. In remarks prepared for delivery on Friday, Britain's Deputy Prime Minister Nick Clegg was to tell the assembly that he had been ready to welcome progress during this week's meeting of the six powers trying to get Iran back to the negotiating table , the U.S., U.N., China, Russia, Britain, France and Germany. "An issue of grave global concern has been overshadowed by the bizarre, offensive and attention-grabbing pronouncements by President Ahmedinejad from this podium yesterday. His remarks were intended to distract attention from Iran's obligations and to generate media headlines. They deserve to do neither," Clegg says in the prepared remarks. The U.N. Security Council has passed four rounds of increasingly restrictive economic sanctions aimed at compelling Tehran to suspend uranium enrichment and return to negotiations on its suspect nuclear program. Iran denies it is trying to build a nuclear weapon, saying its program is meant only for peaceful purposes such as electricity generation. In a brief reference to the sanctions, Ahmadinejad noted that the Nuclear Nonproliferation Treaty allows all signatory nations to use nuclear energy for peaceful purposes. But he said some Security Council members have "equated nuclear energy with nuclear bombs ... while at the same time they have continued to maintain, expand and upgrade their own nuclear arsenals." He added that the United States was spending $80 billion to build up its nuclear arsenal. Still, Ahmadinejad emphasized that Tehran was prepared to negotiate with the United States, U.N., European Union, and other representatives of the international community, "based on justice and respect." Obama, who spoke during the General Assembly's morning session and left without waiting for Ahmadinejad's afternoon address, said Iran was the only party to the NPT that could not demonstrate the peaceful nature of its nuclear program. He said the latest sanctions resolution was meant to make it clear to Tehran "that international law is not an empty promise." "The United States and the international community seek a resolution to our differences with Iran, and the door remains open to diplomacy should Iran choose to walk through it," Obama said. Meanwhile, at least 1,000 demonstrators rallied near the United Nations complex to protest against Iranian President Mahmoud Ahmadinejad's visit. They held purple balloons; red, white and green Iranian flags; and red, white and green umbrellas to ward off the hot autumn sun. Some had confetti. There was a huge papier-mache replica of Ahmadinejad's head with a nuclear missile strapped to the back. Former New York Mayor Rudolph Giuliani told the cheering crowd that they had the support of all democratic nations in the world. Others among the nearly 140 world leaders attending the U.N. General Assembly also addressed the nuclear impasse in their speeches. Iraqi President Jalal Talabani said Baghdad believed in the right of all nations to use nuclear energy for peaceful purposes. "We stress the importance of reaching a peaceful solution in dealing with this issue," he said. Turkish President Abdullah Gul urged the international community to press for the establishment of a Middle East totally free of nuclear weapons. Gul's remarks were likely to irritate Washington, which sees any move to raise the issue of Israel's nuclear arsenal as potentially destabilizing at a time of renewed Israel-Palestinian peace talks. Israel is generally assumed to have assembled a sizable arsenal of nuclear warheads since the 1960s. It has refused to discuss its status as a nuclear power or to join the nuclear Nonproliferation Treaty to which all other countries in the Middle East adhere. Just before Obama's speech, Brazilian Foreign Minister Celso Amorin sharply criticized the United States, saying that the 2003 invasion of Iraq demonstrated that the "blind faith in intelligence reports tailored to justify political goals must be rejected." "We must ban once and for all the use of force inconsistent with international law," Amorin told the General Assembly, adding that all international disputes should be peacefully resolved through dialogue. Qatar's ruler Sheik Hamad bin Khalifa Al Thani echoed the criticism, saying the West's approach of combatting terrorism through wars "had not achieved security, peace or prosperity." "On the contrary, (the wars have) spread destruction everywhere, deprived millions of their livelihoods, spread fear and caused the killing of millions," he said. Other world leaders also took Washington to task for various aspects of U.S. foreign policy, including the nearly five decade-old U.S. embargo against Cuba. "We disapprove and condemn measures such as unilateral embargoes," Sri Lanka's President Mahinda Rajapaksa said. "These embargoes impact not on governments but the most vulnerable sections of the community."