Prime Minister Benjamin Netanyahu warned Iran on Monday that this year could be the last time it celebrates the anniversary of its Islamic revolution if it attacks Israel.
The events commemorate the collapse of the USA -backed government of Shah Mohammad Reza Pahlavi after the Ayatollah Ruhollah Khomeini's 1979 return from exile.
Some demonstrators shouted "Death to Israel, Death to America" - sayings often repeated at the time of the revolution.
At a rally in Tehran, president Hassan Rouhani addressed the crowds for almost 45 minutes, lashing out at Iran's enemies - America and Israel - and claiming their efforts to "bring down" Iranians through sanctions will not succeed.
"We have not asked and will not ask for permission to develop different types of missiles and will continue our path and our military power", President Hassan Rouhani said.
Monday's celebrations in Tehran were also a backdrop to the military's display of Iranian-made missiles, which authorities showcase every year during anniversary celebrations. Iranian state TV, which said millions participated in the celebrations, ran archive footage of the days of the uprising and played revolutionary songs.More news: Oops: Ardern admits admin error caused China flight U-turn
One sign read, "Much to the dismay of America, the revolution has reached its 40th year".
Bolton, a leading hawk in the Trump administration's attempt to weaken Iranian influence, was tweeting as a huge crowd in Tehran gathered to celebrate the 1979 revolution, in which Muslim leader Ayatollah Ruholla Khomeini ended the centuries-old rule of the royal dynasty.
"After 40 years, the Islamic Republic of Iran has failed to fulfill its promises to uphold and safeguard the rights of its citizens", Bolton tweeted Monday morning.
"The presence of people today on the streets all over Islamic Iran means that the enemy will never reach its evil objectives", Rouhani himself told the crowds, vowing the "US conspiracy" against Iran will never succeed.
But despite the official festivities today's Islamic republic faces acute economic challenges as it struggles with a mix of domestic hardships and USA sanctions.
In January, Mr Rouhani said Iran was facing its worst economic crisis since the Shah was toppled. "I am not ignoring the threats of the Iranian regime, but nor I am impressed by them", he said.More news: Rafa Benitez: We should have stopped Wolves equaliser
Washington and its Arab allies have viewed Iran with great suspicion since the Islamic Revolution, fearing Khomeini's radical ideology would inspire militants across the Middle East.
Iranian leaders say they are protecting national interests.
He compared the USA sanctions and economic hardships to "riding a bicycle when someone puts a stick in the wheels" but pointed to advances in other fields as more than making up for them.
"On the revolution's 40th anniversary we are at the top for scientific achievements like nanotechnology or accurate missiles", he said.
Soldiers, students, clerics and black-clad women holding small children flocked to the streets of cities and towns, many carrying portraits of Khomeini and Iran's current supreme leader, Ayatollah Ali Khamenei.More news: U.S. Warships Patrolling Beijing-Claimed Waters Prompt Chinese Protest