The speaker of Iran's parliament Ali Larijani said on Friday that security in the Middle East could be threatened if Tehran was further pressured by its arch foes Israel and Saudi Arabia.

To really understand Israel and the Middle East - subscribe to Haaretz

Tens of thousands of Iranians took part in anti-Israel rallies across the country to mark Iran's annual day of solidarity with the Palestinians. They chanted "Death to Israel" and "Death to America", burning the Israeli flag.

"Israel and Saudi Arabia are the source of chaos in the region. The Saudi Arabia, Israel and American triangle wants to turn the region into a chaotic scene," state television showed Larijani telling demonstrators. "The region's security will be threatened if they corner Tehran."

Israel has strongly backed President Donald Trump's decision to pull out of a 2015 international nuclear deal with Iran. Washington has re-imposed sanctions on Iran and demanded Tehran make sweeping changes from dropping its nuclear program to pulling out of the Syrian civil war.

Supreme Leader Ayatollah Khamenei said on Monday he had ordered preparations to increase uranium enrichment capacity if the nuclear agreement collapsed despite European efforts to keep it alive.

Opposition to Israel, which Tehran refuses to recognize, has been a cornerstone of Iranian policy since its 1979 Islamic revolution. Shi'ite Muslim Iran backs Palestinian and Lebanese militant groups which oppose peace with Israel.

"Israel is failing ... the claim of creating a new regional order is a mistake they are making and it is an illusion ... It is our responsibility to defend Palestinians," Larijani told the crowd in Tehran.

Iran has repeatedly called on its Sunni Muslim rival Saudi Arabia to help improve their strained bilateral relations and work for stability in the Middle East.

"The regional issues should be resolved by regional people, nations and the government," Larijani said.