The US believes Iran is getting closer to developing nuclear arms
He warned of "massive" consequences if Iran was treated unfairly.
Mr Khatami said again that the nuclear programme was peaceful and needed to produce power, rejecting US suspicions that it is a cover for weapons.
EU powers want Tehran to end uranium enrichment - a key part of nuclear arms production - permanently.
"We give our guarantee that we will not produce nuclear weapons because we're against them and do not believe they are a source of power," Mr Khatami told foreign ambassadors in Tehran.
"But we will not give up peaceful nuclear technology," he added.
In the face of international pressure, the Iranian government has called for large numbers of its supporters to go out onto the streets on Thursday to mark the anniversary of the 1979 Islamic revolution.
'Our clear right'
In Washington, President George W Bush said a nuclear-armed Iran would be "a very destabilising force in the world" and urged the West to work together to stop such an outcome.
If we feel others are not meeting their promises, under no circumstances would we be committed to continue fulfilling ours
Mohammad Khatami
The message was reinforced by US Secretary of State Condoleezza Rice during a tour of Europe this week.
She said Washington had no deadline to refer the issue to the United Nations Security Council for possible sanctions, adding that diplomacy had to be given every chance to work.
While talks with Germany, France and Britain continue in Geneva, Iran has suspended uranium enrichment, which can be used to make weapons-grade fuel.
But in his speech Mr Khatami said that enrichment was "our clear right" and that Iran had suspended it only "to show our goodwill".
He added: "If we feel others are not meeting their promises, under no circumstances would we be committed to continue fulfilling ours.
"And we will adopt a new policy, the consequences of which are massive and would be the responsibility of those who broke their commitments."
The European countries would like to use a package of incentives to induce Iran to give up its nuclear ambitions, but Tehran has said it is disappointed with what is on offer so far.
It says it can only continue talks for a matter of months, not years.
Enriched uranium can be used to produce nuclear power, but the technology behind it can also be used to develop weapons-grade nuclear material.
Iranian President Mohammad Khatami said today that his country will never give up its nuclear development process.

Talking to foreign ambassadors in Tehran, he said, "We give our guarantee that we will not produce nuclear weapons because we're against them and do not believe they are a source of power, but we will not give up peaceful nuclear technology."

"Iran has achieved nuclear technology without the help of others, and it will never give up its right to use it under illegitimate pressure from others," Khatami said.

His remarks come as Iran faces increasing pressure to curb its nuclear activities. The United States and the European Union wants the country to give up enriching uranium, a key process in both nuclear power generation and weapons production. Iran claims to have suspended such enrichment—President Khatmi said that enrichment is "our clear right" but that Iran had suspended it only "to show our goodwill". The EU wants a permanent cessation.

Khatami also denounced, "the slanders of the American rulers against the Iranian nation and the establishment", saying they were aimed at "putting a cover on the failures of the extremist US policy".

Newly-appointed U.S. Secretary of State Condoleezza Rice said while touring Europe this week that diplomacy with Iran must be given every chance to succeed, adding that no deadline had been set to take the issue to the UN Security Council.