Iran's president on Monday insisted "enemy" plots against the country would fail as vast crowds marked 40 years since the Islamic revolution at a time of heightened tensions with the United States.
The event was the culmination of official celebrations called the "10 Day Dawn" that mark the period between February 1 and February 11, 1979, when Shiite cleric Khomeini returned from exile and ousted the shah's last government.
State TV showed crowds defying cold rainy weather and carrying Iranian flags while shouting "Death to Israel, Death to America", trademark chants of the revolution.
In a speech at Tehran's Azadi (Freedom) square, Rouhani said USA efforts to isolate Iran would fail.
He said that while Iran will continue to have "constructive engagement" with the global community, it will not ask for permission to produce any type of missile it wants.
Despite mounting worldwide pressure over the country's missile program, Iranian President Hassan Rouhani vowed to continue to push the development of such weapons.
US National Security Adviser John Bolton, who in 2017 expressed hope Iran's "revolution will not reach its 40th birthday", tweeted that after four decades the "Islamic Republic of Iran has failed to fulfill its promises to uphold and safeguard the rights of its citizens".
Stalls set up by state institutions handed out tea and cakes and choirs sang revolutionary songs, as crowds massed despite driving rain.
Every year, the anniversary festivities start on February 1 - the day Khomeini returned home from France after 14 years in exile to become the supreme leader as Shiite clerics took power - and continue for 10 days, climaxing on February 11.
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.
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.
In January, Rouhani said Iran was dealing with its worst economic crisis since the Shah was toppled.
"The Iranian people have and will have some economic difficulties [due to the sanctions] but we will overcome the problems by helping each other", Rouhani said in his address.
The large turnout in state-sponsored rallies came as Iranians face mounting economic hardships. "The U.S. will support the will of the Iranian people, & stand behind them to ensure their voices are heard".
Extensive fireworks displays were held across Tehran on Sunday night, timed to coincide with the demonstrations.