Iran's president on Monday seized on the nationalist fervor of the 40th anniversary of the Islamic revolution and in a speech to crowds in downtown Tehran vowed to press ahead with the country's controversial missile program in defiance of protests in the West, namely from the United States.

Hassan Rouhani, classed a moderate within Iran's theocratic regime, told thousands of people gathered in the capital's Azadi square that his government would continue to expand Iran's military power and influence.

"We have not asked for permission and we will never ask for permission to build missiles," Rouhani said. "We will continue along our road of military and defensive progress," he added.

He said the world had been surprised by Iran's military power. In a demonstration of this power, the country's Revolutionary Guard Corps, an army unit specifically charged with protecting the Islamic Republic's system, displayed examples of the country's Ghadr-110 missile, which has a range of 2,000 kilometers (1,242 miles).

Iran's missile arsenal is the overarching cause for concern for its regional foes, which include Saudi Arabia and Israel, as well as within the wider international community, mainly the US but also the European Union.

US President Donald Trump said Tehran's decision to pursue its ballistic missile program was one of the driving forces behind his withdrawal from the 2015 international nuclear deal, which had seen the Iranian regime swap its nuclear program in for a partial lifting of sanctions.

The remaining signatories, which include Russia, China, France, the United Kingdom, Germany and the EU, criticized the Trump administration for the move as international monitors had consistently found Tehran was abiding by the pact.

Trump's administration went on to apply tough sanctions against Tehran, specifically targeting the country's central bank and oil market.

"The presence of people in the streets across all of the Islamic Republic of Iran shows the conspiracies against the country by the enemy have been ruined," Rouhani said.

At the speech, Rouhani thanked regional allies for their continued support for Iran.

The founding of the Islamic Republic of Iran four decades ago, which is celebrated annually in Iran by supporters of the religious rulers, spun the country's diplomatic compass away from Western influence.

Ayatollah Ruhollah Khomeini, a revered figure in Iran, established the religious theocracy ten days after he returned from exile from France, a moment in history that breathed life into the religious aspect of the revolution that overthrew Shah Mohammad Reza Pahlavi.

The majority of Iranians follow the Shia branch of Islam and Shias across the Middle East region often look to Tehran for religious and political guidance. Sunni Islam has a larger number of adherents globally and is the dominant branch in Iran's regional foe, Saudi Arabia.

Both countries have jostled for influence across the Middle East. Iran has established a network of loosely-affiliated Shia militias throughout the region, from groups in Iraq and Syria to Hezbollah in Lebanon and, allegedly, the Houthi insurgency in Yemen.