"We don't make tough comments, we express our legal rights," Ahmadinejad said. "There are a few countries that are against the progress of other nations. They say any nation that wants to progress must ask for their permission. This is against all international laws. No independent country accepts it."
Ahmadinejad asked directly why Iran shouldn't be allowed a nuclear program when other countries are free to develop their own nuclear capacity.
"Our position is based on international laws," Ahmadinejad said. "You see that those countries who are against us have no legal basis [to support their claims]. They have nuclear power, they even have nuclear weapons, but they tell us we should not have peaceful [nuclear] energy. If the nuclear fuel cycle is a bad thing, then you should not have it either, and if it is good, then why can't [Iran] have it? All countries should have it."
Speaking earlier at today's Economic Cooperation Organization summit, the Iranian leader told heads of state and other top officials that so-called "enemies" of his country must "begin respecting the people of Iran."
He also accused Western countries of trying to establish a "nuclear apartheid" by attempting to block programs like Iran's, which he said was for energy purposes only.
Ahmadinejad appeared to have received a warm reception in Baku.
The summit's host, Azerbaijani President Ilham Aliyev, added his voice in supporting Iran's right to develop peaceful nuclear energy.
"Everything should be resolved based on the norms and principles of international law," Aliyev said. "If international law and regulations of international organizations provides the opportunity for a country to obtain nuclear energy, then there should not be any contradiction [in] this respect."
Aliyev also appealed to the international community to resolve the Iran nuclear standoff through diplomatic efforts.
The summit was short-lived, opening and closing today. On May 4, diplomats from ECO countries met to discuss trade, transport, and the region's energy security.
The ECO consists of Iran, Pakistan, Turkey, the five countries of Central Asia, Azerbaijan, and Afghanistan.
The talks were largely overshadowed by the Iran nuclear standoff -- and the presence of Ahmadinejad. The Iranian leader met on the sidelines of the summit today with top officials from Afghanistan, Azerbaijan, Pakistan, and Turkey.
Ahmadinejad reportedly urged fellow ECO members to cooperate at a time when, in his words, "big powers" are attempting to "consolidate their domination and influence."
Ahmadinejad's comments come while the five permanent members of the UN Security Council are discussing a French-British draft resolution demanding a halt to Iran's uranium enrichment. The draft says Iran could possibly face further action, which could include sanctions.
Speaking on May 4, Iran's ambassador to the UN accused the United States and its allies of creating a crisis by tabling the draft resolution.
Javad Zarif said there was a need for "serious" and "reasonable" discussion.
"If [the draft resolution] is an attempt to get Iran to agree, it's not a good one," Zarif said. "I think Iran has made it very clear that we are prepared to move forward with transparency measures, Iran is prepared for a negotiated solution, but we always made it also clear that Iran does not respond well to threat and intimidation."
Russia and China, who are both members of the Security Council with power of veto, are reportedly against strong action.
(RFE/RL's Azerbaijani Service contributed to this report.)
What Would Sanctions Mean?
MOVING TOWARD SANCTIONS: If the United Nations Security Council imposes sanctions on Iran, domestic support for Iranian President Mahmud Ahmadinejad will wane, according to ALEX VATANKA, Eurasia editor for Jane's Information Group.
Vatanka told a February 24 RFE/RL briefing that "economic sanctions will hurt the average Iranian" and, consequently, many "will blame the ruling clerics" for making life difficult and "impairing the country's long term development."
Vatanka said sanctions would be a serious challenge to the Iranian government. If harsh economic sanctions were imposed, Iran's poorest population will be hurt the hardest -- and might react "as they did in the 1970s and protest in the streets." Sanctions on travel, Vatanka said, would hurt a many Iranians because "Iran is a nation of small traders" who depend on the ability to travel to earn an income. According to Vatanka, unemployment in Iran is estimated at 30 percent, "so small trading is essential to survival." Although current U.S. sanctions "haven't worked," he said, "Iranians fear an oil embargo." He stressed that "oil revenues are a major part of the economy, so it is critical to look at this sector."
Should negotiations with the European Union and the UN fail, Vatanka believes that Iran would follow a "North Korea model," since Ahmadinejad's base of support among the "Islamist militias" has been "urging withdrawal from the NPT [Nuclear Non-Proliferation Treaty]." The Iranian government's "tactic" so far, Vatanka said, is governed by the belief that "by shouting the loudest, you'll get concessions [from the West]."
LISTEN
Listen to the complete panel discussion (about 60 minutes):
THE COMPLETE STORY: RFE/RL's coverage of the controversy surrounding Iran's nuclear program.