"We have no intention to build nuclear weapons, it is not in our defense strategy to develop a nuclear weapon," he told a press conference on the sidelines of the Organisation of the Islamic Conference (OIC) summit in Malaysia.
He said the IAEA demands were unfair, "but we have no intention to interrupt our cooperation with the IAEA, we continue to cooperate with the agency."
The IAEA has been pressing Iran to sign an additional protocol to the nuclear Non-Proliferation Treaty (NPT), which would give the watchdog the right to carry out unannounced inspections of suspect Iranian facilities.
The agency has given Iran until October 31 to answer questions on its nuclear programme, amid fears it is trying to develop nuclear weapons.
"We have never said Iran will never join the protocol and we have no problem in principle," said Khatami. But he accused the United States of setting additional conditions that "jeopardise the national interests" of Iran.
"We just want to deal with this matter in a legal framework," he said, accusing Washington of putting "political pressure" on Tehran.
But he played down the possibility of a military conflict with the United States, saying that Washington would not want to make a "third mistake" in Iran after the invasions of Afghanistan and Iraq.
Khatami said because his country had existing stocks of uranium, it had a legitimate right to continue enriching it for peaceful purposes.
"It is our intention and our determination to have and to develop peaceful nuclear technology ... despite all sanctions, all propaganda campaigns and all political pressures."
"And we are going to rely on our resources to develop this peaceful technology, we have very good resources, uranium resources in our country."
He said US experts estimated before the 1979 Islamic revolution that nuclear-generated power was "quite economical" for Iran with potential to produce 800 megawatts of electricity.
He added that before the revolution that toppled the Shah, Iran had contracts with Germany and other countries to develop nuclear energy, as it currently has with Russia.
Khatami said he discussed nuclear cooperation with Russian counterpart Vladimir Putin, who is attending the conference as an observer, and they "emphasised Russian cooperation for the completion of the Bushehr nuclear plant project".
IAEA head, Mohamed ElBaradei, who Thursday paid a flying visit to Tehran to press for quick answers over its nuclear program, said he received assurances of Iran's "readiness" to open up its suspect facilities.
Khatami described the talks with ElBaradei as "very fruitful."
He said Tehran was against nuclear proliferation because of religious and ideological principles and "our dedication to dialogue among civilisations."
"We have some concerns that must be addressed, but we know about their concerns expressed in Europe for the development of weapons of mass destruction, of course we understand this concern, it is dangerous for the international community."
He renewed Iran's call to "make the Middle East free of nuclear weapons," referring to Israel's military nuclear capacity.