Iran's president has warned that Muslims around the world will take revenge on states which support Israel against the Palestinians.
Ahmadinejad has questioned the extent of the Holocaust many times
Mahmoud Ahmadinejad again questioned the extent of the Holocaust, when German Nazis murdered six million Jews.
Israel was founded on "claims about the Holocaust" for which the Palestinians were paying the price, he told a rally.
He was speaking on Jerusalem Day, when there are large demonstrations in Iran in support of the Palestinians.
BBC Tehran correspondent Frances Harrison says the tone of the speech was hardline, even by Mr Ahmadinejad's standards.
Mr Ahmadinejad called Israel's leaders a "group of terrorists" and appeared to threaten any country that supports it.
"You imposed a group of terrorists... on the region. It is in your own interest to distance yourself from these criminals... This is an ultimatum. Don't complain tomorrow."
The "ultimatum" was directed at European states in particular.
"We have advised the Europeans that the Americans are far away, but you are the neighbours of the nations in this region," Mr Ahmadinejad said.
"We inform you that the nations are like an ocean that is welling up, and if a storm begins, the dimensions will not stay limited to Palestine, and you may get hurt."
Mr Ahmadinejad said Israel no longer had any reason to exist and would soon disappear. "This regime, thanks to God, has lost the reason for its existence. Efforts to stabilise this fake regime, by the grace of God, have completely failed."
Mr Ahmadinejad said: "Even if we assume the Holocaust is true, then why should the Palestinians pay the price for it."
He said millions of Israelis should go back to their countries of origin.
Mr Ahmadinejad said Lebanese Hezbollah militants had shattered the myth of Israel's military power, so that "Zionists" in their homes in various corners of the world, could not now enjoy security.
The Iranian president has regularly questioned the extent of the Holocaust, and been a trenchant critic of Israel.
In 2005 he drew widespread and angry international criticism when he approvingly quoted comments by Ayatollah Khomeini that Israel's existence should be brought to an end.