Others carried pictures of Ayatollah Ruhollah Khomeini, the Shi'ite religious leader whose return from exile led to the ouster of Iran's Shah.
In a February 8 speech to a gathering of Iranian Army Air Force officers, Iran's Supreme Leader Ayatollah Ali Khamenei said that Iran will not give up the "Death to America" chant as long as Washington continues its hostile policies toward Tehran.
Iranian political and military officials have also attended the rallies along with other people to rejoice at the auspicious ceremony.
According to Channel 12 news, the factory is meant to focus on producing precision missiles, dramatically upgrading the threat to Israel from the vast arsenal of rockets and missiles deployed against it in southern Lebanon by Iran's proxy, Hezbollah.
"It has been moving forward over the past 40 years and making Iran stronger".
The large turnout in state-sponsored rallies, in which US and Israeli flags were burned, came as Iranians face mounting economic hardships many blame on the country's clerical leaders.
In Washington, US National Security adviser John Bolton, who in 2017 expressed the hope that Iran's "revolution will not reach its 40th birthday", tweeted that after 40 years, the "Islamic Republic of Iran has failed to fulfil its promises to uphold and safeguard the rights of its citizens".
In a speech at Tehran's Azadi (Freedom) square, Rouhani said US efforts to separate Iran from other countries would fail.More news: Ariana Grande celebrates first Grammy victory from 'lowkey' party at home
More news: First Look at Will Smith as Blue Genie in Disney's Aladdin
More news: 'Unusual' sentencing of mosque shooter Bissonnette likely to be appealed
Last year, Iran cracked down on protests over poor living standards that posed the most serious challenge to its clerical elite since a 2009 uprising over disputed elections.
Prices of bread, cooking oil and other staples have soared since President Donald Trump withdrew Washington from the 2015 nuclear deal past year and reimposed sanctions.
In his address on Tehran's Azadi Square, Rohani said the "enemy will never reach its evil objectives", vowing that Iran will defeat USA sanctions.
"Today we are the target of a psychological and economic war", he said, the news outlet reported.
Brigadier General Hossein Salami, the Revolutionary Guards deputy head, said Tehran would not withdraw forces from the region, dismissing USA calls for Iranian clout to be curbed. But he remained defiant as Iranians recalled the end of a monarch who catered to the rich and unleashed secret police on dissenters.
Israeli Prime Minister Benjamin Netanyahu dismissed the threat.
"Were this regime to make the bad mistake of trying to destroy Tel Aviv and Haifa, it would not succeed, but it would mean that they had celebrated their last Revolution Day". However, analysts say Iran's push to back militants in the wider Mideast and Saudi Arabia's efforts to mobilize the Sunni world against the Shiite power would turn many away.
Israel and Iran have not maintained diplomatic relations since the Islamic Revolution of 1979.