Without specifically naming them by name, Ahmadinejad said Washington and its allies had been had bullying Iran - who they accuse of trying to develop nuclear weapons - and pressing the International Atomic Energy Agency (IAEA).
"The countries that feel threatened ... should prepare for defence, and even counterattack"
Adolfo Talpalar, Stockholm, Sweden
Send us your views
"Fortunately, the IAEA has recently tried to regain its legal role as supporter of the rights of its members while supervising nuclear activities," Ahmadinejad said.
"Today, because of the resistance of the Iranian nation, the issue is back to the agency, and I officially announce that in our opinion, the nuclear issue of Iran is now closed and has turned into an ordinary agency matter," he said.
"Of course Iran has always been and will be prepared to have constructive talks with all parties," he added.
In a 40-minute speech, the Iranian leader went on to accuse Washington of human rights abuses in its "war on terror" with allusions to CIA imprisonment and interrogation programmes in foreign countries, and detention in camps such as Guantanamo Bay.
"Unfortunately human rights are being extensively violated by certain powers, especially by those who pretend to be their exclusive advocates," Ahmadinejad said.
"Setting up secret prisons, abducting persons, trials and secret punishments without any regard to due process, extensive tapping of telephone conversations intercepting private mail … have become commonplace and prevalent," he added.
He also criticised the US-led invasion of Iraq, which he said was "occupied under the pretext of overthrowing the dictator and the existence of weapons of mass destruction".
"Unfortunately, we are witnessing the bitter truth that some powers do not value some nations or human beings and the only things that matter to them are themselves, their political parties and their groups.
"In their view, human rights are tantamount to profits for their companies and their friends. The rights and dignity of the American people are also being sacrificed for the selfish desires of those holding power," he added.
But the US delegation was not in the chamber to hear the criticism.
And Bush gave no more than a passing mention to Iran in his speech earlier, even though his administration is calling for stronger sanctions against Tehran.
In fact, Bush's address was notable for what he did not say - barely a mention of Iraq either, where the US is seeking greater UN input.
Like the US, the Israeli delegation did not stay to hear Ahmadinejad's speech as the Iranian president also blasted Israel as an "illegal Zionist regime".
"For more than 60 years, Palestine, as compensation for the loss they [Jews] incurred during the war in Europe, has been under occupation of the illegal Zionist regime.
"The Palestinian people have been displaced or are under heavy military pressure, economic siege or are incarcerated under abhorrent conditions.
"The occupiers are protected and praised, while the innocent Palestinians are subjected to political, military and propaganda onslaughts.
"The people of Palestine are deprived of water, electricity and medicine for the sin of asking for freedom, and the government that was freely elected by the people is targeted," he said.
The Iranian leader also criticised the UN Security Council for being an exclusive club answerable to no one.
He said members of the club were the aggressors in war – Iraq – or failed to stop aggression in war, referring to Lebanon.
Warning that those in power were in the "sunset of their times", he urged them to "leave the path of arrogance and Satan, to that of God".
"This means moving to purity, honesty, justice, and respecting human dignity."