"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 in a speech at Tehran's Azadi (Freedom) square.
"I bow in admiration to Iran's resilient people who - despite hardships and grievances - today poured into streets by the millions to mark 40th anniv of their Islamic Revolution, which some in the USA wished would never come", Iranian Foreign Minister Mohammad Javad Zarif tweeted.
Ceremonies were held across Iran today to observe the anniversary of the fall of the Shah and the triumph of Ayatollah Ruhollah Khomeini, the Shiite cleric who led the coup.
Iranians celebrated the 1979 overthrow of Shah Mohammad Reza Pahlavi, who was supported by the US, "waving Iranian flags, chanting "Death to America" and burning USA and Israeli flags", reported The Associated Press.
Iran displayed its ballistic missile capabilities during a parade marking the anniversary, including the Zolfaqar, a ground-to-ground missile with a 700 kilometre (435 mile) range and the Qiam, with a range of 800 km, according to Tasnim news agency.
Rouhani was referring to the Kingdom of Bahrain, which Iranian officials in the past have referred to as the "14th province".
The regime also declared a mass amnesty, with a fifth of prisoners set to leave the country's overcrowded prison system.
Following reports of a second failed space launch by Iran in less than a month, the U.S. State Department last week called for "tougher global restrictions to deter Iran's missile program".
The state has played up this year's anniversary as 40 is symbolic of maturity in the Islamic tradition and the age at which Prophet Mohammed received revelations from God.
"The Iranian people have and will have some economic difficulties but we will overcome the problems by helping each other", he said.
Iranians march towards Azadi Square during Monday's rally.
Crowds chanted "Death to America, death to Israel" as hundreds of thousands of Iranians gathered at rallies to mark the 40th anniversary of the Islamic Revolution. "They must leave the region", said Brig.
"We are here to support the revolution", the 57-year-old pensioner, who refused to give his first name, told AFP at the event in Tehran. Unlike many other news organizations, we have not put up a paywall.
A senior commander in Iran's Revolutionary Guards said Tehran would not withdraw its forces from the region, dismissing US calls that Iranian regional influence should be curbed.
Before the fireworks, supporters of the revolution shouted chants of "Allahu Akbar" (God is greatest) from rooftops, recalling the protests that swept Khomeini to power four decades earlier.
A pre-prepared resolution was read out ahead of his speech that proclaimed "unquestioning obedience to the supreme leader Ayatollah Ali Khamenei" and called US President Donald Trump an "idiot".