"Pressure by certain Western countries aiming to make us abandon our (nuclear) rights will not show results," the Iranian president said on Friday, according to the official IRNA news agency.
The declaration was Ahmadinejad's first since major world powers offered Iran a new deal on Thursday to halt its nuclear activities.
"Unfortunately, some countries that possess nuclear weapons arsenals...want to deprive us of our absolute rights," he said.
Details of the offer have not been made public, but diplomats in Vienna said the deal outlines incentives for Iran to suspend uranium enrichment and return to the negotiating table - with the United States included in the talks.
The package also contains the threat of UN action if Tehran does not comply.
Condoleezza Rice, the US secretary of state, said Iran was facing a "moment of truth".
Ahmadinejad said that Western countries' hostility towards Iran's nuclear ambitions was not because of "their preoccupation with nuclear arms, but because mastery of the technology by Iran means that all independent countries, particularly Islamic countries, will be able to master advanced technologies".
He said Iran was "carrying out its (nuclear activities) in the framework of International Atomic Energy Agency (IAEA) rules in full cooperation and there is no reason to break cooperation with the agency".
Iran insists its nuclear programme is solely for peaceful civilian purposes.
The US believes Iran is using the programme as a cover to develop nuclear weapons.