Iran was determined to expand its military power and ballistic missile programme despite pressure from hostile countries, state TV reported Rouhani as saying.
Iranians thronged streets across the country, many with portraits of Ayatollah Ruhollah Khomeini, the Shiite cleric who toppled the Shah in the historic Islamic uprising.
Washington alleges Iran's launches defy a U.N. Security Council resolution calling on Iran to undertake no activity related to ballistic missiles capable of delivering nuclear weapons. It later broadcast footage showing crowds across the country of 80 million.
Iran's president also insisted that Iranians "have not asked and will not ask for permission" to develop different types of missiles, Rohani said.
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 Tehran, crowds streamed in the rain from a dozen of the capital's far-flung neighbourhoods to mass in central Tehran Azadi, or Freedom Square, on Monday, waving Iranian flags and chanting "Death to America" - a chant that has been standard fare at anti-U.S. rallies across Iran.
People across Iran are taking to the streets today to mark the 40th anniversary of its Islamic Revolution - an event that has gone on to define the country and its position within the world.
Iranians walk past a missile during a rally marking the 40th anniversary of the 1979 Islamic Revolution, in Tehran, Iran, Monday, Feb. 11, 2019.
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.
"Perhaps worst of all, the people of Iran have suffered grievously". Iranian people have and will have some economic difficulties but we will overcome the problems by helping each other, ' Rouhani said.
"We will not let America become victorious..." Rather, they are directed at national leaders.
That April, the Islamic Republic of Iran was proclaimed following a referendum.
Citing leaked Iranian Judiciary documents, the Paris-based media watchdog also said that the authorities had arrested, imprisoned, or executed at least 860 journalists in the three decades between the 1979 revolution and 2009.
Current supreme leader Ayatollah Ali Khamenei is set to publish "a detailed statement explaining the "second step" of the progress of the Islamic revolution", his official website said.