Earlier this month, Palestinians marked the 50th anniversary of the 1967 Six-Day War, which saw Israel occupy the West Bank, East Jerusalem al-Quds, the Gaza Strip and part of Syria's Golan Heights.
"The missiles shot at Daesh were mid-range - you can imagine the power of our long-range missile", Khatami said, using an Arabic acronym for Islamic State.
Parliament speaker Ali Larijani was set to address the crowds before midday prayers.
Iran's ballistic missile program has been the subject of persistent concern in Washington and the target of repeated U.S. sanctions.
Some demonstrators burnt Israeli and American flags.
Opposition to Israel is a touchstone of belief for Shi'ite-led Iran, which backs Palestinian and Lebanese Islamic militant groups opposed to peace with the Jewish state, which Tehran refuses to recognise.
'I was frozen': Cosby accuser says she was drugged, groped
Angela Agrusa claims her line of questioning will show Ms Constand changed her mind about the date of the alleged 2004 assault. So far, more than 50 women have come forward to accuse the former Cosby Show actor of drugging and sexually assaulting them.
"The message of Quds Day is hate for a usurper regime of occupation and support for an oppressed nation with a great culture, the people of Palestine, who have been suffering 70 years from tyranny and injustice", asserted the Iranian president.
The rally also inaugurated a huge digital countdown display at Tehran Palestine Square, showing that Israel will allegedly cease to exist in 8,411 days.
One video showed Rouhani's security guards rushing him into his auto while others prevented protesters from approaching.
In comments ahead of the rallies, Iran's Supreme Leader Ali Khamenei said the rallies were meant to "fight arrogance and global hegemons" likely hinting at recent tensions with Sunni Gulf states.
The figure of 8,411 days - or just over 23 years - on the panel is based on a speech which Khamenei gave almost two years ago predicting Israel would no longer exist by 2040.
"38 years after Imam Khomeini's initiative, the issue of Palestine, beyond the geography of the Muslim world, has become a matter of concern for the human community, especially for the freedom-seeking and justice-seeking nations".
"The ugly action of a small group insulting the president can not damage national unity... and the strong support for Mr Rouhani", wrote Massoumeh Ebtekar, the president's deputy on environmental affairs.