In a sermon at Tehran University, Iran's top cleric accused the West of trying to bully the Islamic republic into abandoning atomic energy technology but said its campaign did not have the backing of the wider international community.
"We are not in the 19th century and Iran is not ruled by a lackey regime. Today the Iranian nation and its officials are feeling as solid as a mountain and we are not afraid of anyone," Khamenei insisted.
"We have the ability to defend ourselves and no official has to right to compromise our rights."
Allegations that Iran is seeking nuclear weapons were, he said, "tricks and lies".
"Our governments and I myself have said numerous times that we are not seeking nuclear weapons. The uranium enriched in Iran is only enriched three to four percent, whereas for a nuclear bomb uranium must be enriched 94 to 95 percent."
Iran is at loggerheads with the international community after resuming uranium ore conversion, the precursor to the process of enrichment, at a facility near Isfahan.
The step ended a nine-month freeze agreed during talks with Britain, France and Germany -- which have been trying to convince Iran to give up a technology that could also be directed to producing a bomb.
The International Atomic Energy Agency has called on Iran to halt all nuclear fuel cycle work and the UN watchdog is to report September 3 on its compliance with international safeguards.
Iran has refused to backtrack despite the risk of being referred to the UN Security Council.
"I tell you, the Iranian nation, will not accept blackmail and extortion," Khamenei said, drawing chants of "Death to America", "Death to Israel" and "Death to Britain" from thousands of worshippers.
Khamenei said the international community had also failed to line up alongside the United States -- which has refused to rule out using military option to curtail Iran's nuclear drive -- and the Europeans in their bid to win Iran's compliance by offering incentives.
"The comments made by the Europeans say that there is a consensus against Iran: but no such thing exists. There is no consensus. There are even some European countries who are against such bullying," he said.
"The consensus is against nuclear weapons, the centre of which is the United States and the most dangerous of which is the Zionist regime (Israel)."
Khamenei said that regardless of Iran's diplomatic woes, it would press on with its effort to master the entire nuclear fuel cycle.
"We want uranium from our mines to use in our installations to make nuclear fuel for our plants," he said.
"What they (the Europeans) tell us is they want to build the plants themselves and provide the fuel themselves, which means we would be dependent on them. The nuclear matter for us is a matter of science and economics."
Tehran insists it has the right to nuclear technology for peaceful purposes under the Non-Proliferation Treaty. But although Iran has resumed uranium conversion, it has so far maintained its suspension of uranium enrichment at its Natanz facility.
"Up to now we did not breach any international accord." Khamenei said, adding that the regime's policy remained one of "negotiation, understanding and building trust".
"But this trust building should be two sided. These three European countries are telling us to build trust, now I tell them to do something so we trust them," he added.
Khamenei's sermon was followed by a rally in support of the nuclear progamme in Tehran. State television said similar demonstrations were also held in other cities.