Khamenei was speaking hours before the resumption of talks between Iran and the European Union in Geneva. (Agencies)
“We had announced previously that on certain issues, if we feel it is expedient, we would negotiate with the Satan (the United States) to deter its evil," Khamenei told a gathering, reported by the official IRNA news agency.
"The nuclear talks showed the enmity of America against Iran, Iranians, Islam and Muslims."
Talks between Iran and the EU started in Geneva on Thursday to discuss the practical details of implementing a nuclear agreement reached in Geneva in November, an EU spokeswoman in Brussels said. US Undersecretary of State for Political Affairs Wendy Sherman is also due to take part.
"I hope during the two-day talks we can resolve the remaining technical issues which are based on our different interpretation of text of the November accord," Iran's top negotiator Abbas Araqchi told state television in Geneva.
The Geneva deal was designed to halt Iran's nuclear advances for six months to buy time for negotiations on a final settlement. Scope for diplomacy widened after Iran elected the pragmatic Hassan Rouhani as president in June. He had promised to reduce Tehran's isolation and win an easing of sanctions.
Despite fierce criticism by political and religious hardliners, who see the agreement as an infringement of Iranian sovereignty, Khamenei had previously backed the accord.
Under the deal, Iran will curb its atomic activities in return for some easing of the international sanctions that have battered the oil producer's economy.
Iran says its nuclear work is entirely peaceful but the West suspects it is aimed at acquiring a nuclear bomb capability.
Russian President Vladimir Putin and Rouhani spoke by telephone on Thursday, discussing Iran's nuclear standoff with the West and aspects of "carrying out agreements reached on the Iran nuclear programme," the Kremlin said in a statement.
They also discussed the conflict in Syria, Iranian media reported. Iran is under UN, US and European Union sanctions for refusing to heed UN Security Council demands that it halt all enrichment- and plutonium-related work at its nuclear sites.
Khamenei said international sanctions imposed on Iran had not pressured the Islamic state to enter negotiations with major powers.
"Our enemies do not know the great Iranian nation. They think that their imposed sanctions forced Iran to enter negotiations. No, it is a wrong," Khamenei said.
Sanctions, though, are clearly having an impact, the country's oil revenue has been slashed and other trade disrupted.
Nuclear experts from Iran and the six powers have held several rounds of talks since November 24 to resolve various technical issues before the interim deal can be put into place.
The experts have to work out when the accord will be implemented. Western diplomats and Iranian officials say the six powers and Iran want to start implementing the deal on January 20.
"First the interim agreement needs to be implemented. I think that by the end of January, or at least I hope, it will be implemented. That's the interim period," said French Foreign Minister Laurent Fabius on Wednesday.
Diplomats told Reuters on Wednesday that the nuclear talks on implementing the landmark November deal have run into problems over advanced centrifuge research, highlighting the huge challenges facing Iran and the six powers in negotiating the precise terms of the deal.
Iran says centrifuge research is crucial. Centrifuges purify uranium for use as fuel in atomic power plants or, if purified further, weapons.
If the talks succeed, they plan to start talks on a long-term deal to resolve a more than decade-long dispute over Tehran's nuclear ambitions.
"The biggest problem will be the next phase because the question that hasn't been dealt with is: Do our Iranians partners want to just suspend production that could lead to them having a nuclear weapon or do they accept to give it up completely?," Fabius said.
"Obviously, the second option is what's acceptable, because the first none of the P5+1 will accept," he added.
Khamenei was speaking hours before the resumption of talks between Iran and the European Union in Geneva.