President Mahmoud Ahmadinejad has insisted on Iran's right to develop nuclear fuel while staying within international rules.
Iran says it wants nuclear power, not nuclear weapons
Mr Ahmadinejad accused the West of making false offers - calling for talks and then insisting that Tehran first halts its uranium enrichment work.
The president was addressing a mass rally in Tehran, marking the 28th anniversary of the Islamic revolution.
Iran has been high on the agenda at a security conference in Munich.
Iran's chief nuclear negotiator, Ali Larijani, met European Union foreign policy chief Javier Solana on the sidelines of the conference.
Mr Solana said after the meeting no deal had been reached but possible solutions were being explored.
It was their first meeting since the collapse of talks last year and the imposition in December of limited UN sanctions on Tehran for its failure to stop the enrichment of uranium.
In Tehran, the BBC's Frances Harrison says school children waved flags and screamed hysterically when the president appeared at the podium to speak.
The capital's largest square was packed with people, some holding posters comparing the US president to Adolf Hitler or making fun of US Secretary of State Condoleeza Rice.
Mr Ahmadinejad accused Iran's enemies of trying to use the nuclear issue to undermine its independence.
"Today, the pretext of their opposition is the progress the Iranian nation has made in the field of nuclear energy," he said.
The president said Iran had no intention of pulling out of the Nuclear Non-Proliferation Treaty but added that it would be a "humiliation" to abandon its programme.
He said he would defend the rights of the Iranian people "within the framework of the law".
Our correspondent says this gives little hope of a change of heart just 10 days ahead of a UN deadline to stop enriching uranium or face broader economic sanctions.
Uranium enrichment is a process that can make fuel for power stations or, if greatly enriched, material for a nuclear bomb.