Tehran, Iran (CNN) Iranian President Hassan Rouhani stood before a big crowd celebrating the Islamic Revolution's 40th anniversary on Monday and vowed to boost his country's military and ballistic missile program, defying US pressure and sanctions.

"Iran will continue to expand its military might and missile program," Rouhani said in front of tens of thousands of people who had gathered in Tehran's Azadi (Freedom) Square to mark the 1979 overthrow of Shah Mohammad Reza Pahlavi, a Western-installed monarch, which paved the way to clerical rule.

US President Donald Trump has said that the economic sanctions he re-imposed in 2018 sought to keep Iran's military -- namely its ballistic missile program -- in check.

Tehran has tried to present the anniversary rallies as a show of support for the regime and Rouhani has accused Trump of openly agitating for regime change in Iran.

"Today we are the target of a psychological and economic war. Enemies who seek to belittle us, we must resolve these problems with one another," said Rouhani on Monday. "With the assistance and the help of one another ... we will be victorious in the face of America."

Iranian President Hassan Rouhani speaks during a ceremony celebrating the 40th anniversary of the Islamic Revolution in Azadi Square, Tehran, on February 11, 2019.

'Death to America'

The recital of Quranic verses mixed with revolutionary chants as a sea of people carried Iranian flags and demonstration banners. Stalls that lined the road to the main square distributed information pamphlets, hosted live radio shows and showcased young children singing Islamic and nationalist anthems.

Protesters carry life-sized cardboard images of iconic revolutionary figures, including Supreme Leader Rouhallah Khomeini.

"When we say 'Death to America' we mean down with Trump, and (US Secretary of State Mike) Pompeo," said cleric Mohammed Reza Maqsood, 32, referring to the inflammatory chant that has long been a staple of the Islamic Republic's national celebrations.

Maqsood was echoing an address made by Iran's Supreme Leader Ali Khamenei on Friday where he said that "Death to America" applied only to "Trump, (National Security Adviser) John Bolton and Pompeo."

"I chose to come here and rally so that I can see. I don't need a higher education to see the support here," Maqsood added.

'Conflict with the Islamic Republic would fail'

The chief of the Iranian military's elite Revolutionary guards was also among the crowds marching to Azadi Square.

In a rare interview with Western media, Major General Mohammad Ali Jafari told CNN: "With the missiles we have right now, with the progress in high technology and with the self-reliance we have achieved in various fields, and also with the growth of the population in Iran, we have the power and capacity to defend against any kind of invasion."

Jafari said popular support for the government, as well as Iran's "expanded defense system" has rendered the Islamic Republic "invincible."

"The Americans and other big powers know that a conflict with the Islamic Republic would fail," said Jafari. "They have started a soft war, a cultural, political and economic war against us, and our people have understood that. They are resisting and they are prepared."

Nostalgic fervor

Iranian authorities have tried to build up anticipation for the anniversary. For days, state-aligned TV stations have aired archival footage from the 1979 protests. They re-ran dramatic video of the country's first Supreme Leader Ayatollah Rouhallah Khomeini arriving in Tehran after 14 years in exile and replayed the charismatic leader behooving crowds to shake off the shackles of "Western imperialism."

Ayatollah Rouhollah Khomeini greets the crowd at Tehran University after his return to Iran during the Iranian Revolution.

The government's messaging centered around the slogan "Yes, we can," an apparent acknowledgement of the difficulties millions of Iranians face under the strain of renewed US sanctions.

Prices have soared, the rial currency has plummeted and food and medical shortages have affected households across Iran. But authorities say that the country is no stranger to hardship, and regularly invoke its people's "steadfastness" in the eight-year war with Iraq in the 1980s.

On Sunday night, fireworks lit up Tehran's sky and some conservative neighborhoods echoed to calls of Allahu Akbar (God is great). This was a tribute to an oft-recalled scene from the revolution exactly 40 years earlier. On the night before it was declared that the Shah had officially abdicated, Iranians took to their balconies, beating pots and pans as 'Allahu Akbar' reverberated across the capital.

Widening inequality

While many people attest to the fervor that gripped Iranians at the time, several former revolutionaries privately say they feel disillusioned by how the political and economic situation played out.

"We succeeded in creating cultural change, in making the country more religious," said businessman Abolqasem Shafie who participated in the Islamic revolution's demonstrations. "But I think that in terms of economics, there is a lot to be desired."

Since the revolution, literacy rates have skyrocketed and access to healthcare and education has improved, particularly in rural areas and the provinces.

Yet signs of widening inequality, as well as widespread reports of government corruption and cronyism, have weighed heavily on an economy that has been repeatedly hit by international sanctions over the last 40 years.

"There's been a big push at a grassroots level inside Iran over the past year, as demonstrated by protest movements ... to actually deal with issues to do with corruption and mismanagement of domestic affairs," said Ellie Geranmayeh, Senior Policy Fellow at the European Council on Foreign Relations (ECFR).

"This is going to be a big issue ... for not just the existing Rouhani government but any successive government that comes to power."

For some, these problems have marred an event that would otherwise have been cause for celebration.

"I am not proud of this anniversary," said one man in his late 20s, who requested anonymity for security reasons. "This isn't the Fourth of July. It's not something we should be proud of. People like me have not achieved what they wanted."

Iranians enjoy the ceremony on Monday.

He added, however, that he has no nostalgia for the days of the Shah, despite wishing to regain the social freedoms that were lost as Iran transformed into a theocracy. His father participated in the demonstrations four decades ago -- to undo what the revolutionaries had done, he argued, would mark "a step backwards."

'Trump shouldn't be involved'

The man said that the US president's attack on the regime should stop. "Trump shouldn't be involved in these things. This is my country and we know what's better for us."

Instead of pitting Iranians against the regime, the Trump administration's attempts to isolate the country and support anti-regime protesters have only called up images of war, some Iranians said. "My friends and I would rather stick to this regime than have a war like in Syria and Iraq," said the man.

ECFR's Geranmayeh said that there is a "deep distrust" and doubt about future deals growing once again between Iran and the West.

"Will Iran come to the negotiating table once more with the United States? So far, the messaging is no, not until the US comes back to the nuclear deal and meets its commitment," she added.