"But the Security Council has no legitimacy among the peoples of the world," he told a rally in the central Yazd province.
The punitive measures under discussion by the five permanent Security Council members, Britain, China, France, Russia and the United States plus Germany, involve an arms embargo as well as some financial and trade restrictions that build on the first sanctions imposed in December.
"What is the aim of issuing such resolutions? Today we are mastering the nuclear fuel cycle completely," Ahmadinejad said.
"If all of you [Westerners] get together and call your ancestors from hell as well, you will not be able to stop the Iranian nation."
Western nations suspect Iran's nuclear programme is a cover for efforts to make atomic weapons, a charge Tehran denies.
Washington says it wants a diplomatic solution, but has not ruled out military action.
Sanctions deal reached
Diplomats at the United Nations representing the United States, Britain, France, Germany, Russia and China have reached a tentative deal on imposing sanctions on Iran they hope to introduce to the Security Council on Thursday, providing their governments agree.
"It is stubbornness and pride on Iran's part that has led to this impasse, and it can only lead to disaster for Iran"
Diom1982, Cork, Ireland
Send us your views
The measure, which may be adopted next week, would penalise Tehran for refusing to suspend uranium enrichment, which can be used in nuclear bombs or in civilian power stations.
Ahmadinejad said imposing sanctions on Iran would have the opposite result.
"You sanctioned us in the past but we obtained the nuclear technology. Impose economic sanctions on us today and see what would be our next step," Ahmadinejad said.