The march is the culmination of official celebrations called the "10 Day Dawn" that marks the period in February 1979 when the revolution's leader Khomeini returned from exile and toppled the monarchy.
Read more: What is Iran's Revolutionary Guard?
Downtown Enghelab, or Revolution Street, was decorated with giant balloons and loudspeakers blasted revolutionary and nationalist songs to encourage people to join the rallies. Fireworks displays were also held across Tehran on Sunday night.
Anti-US sentimentCrowds streamed to Freedom Square waving Iranian flags and chanting "death to America" — a slogan that can often be heard at anti-US rallies across Iran.
Last week, Supreme Leader Ayatollah Ali Khamenei defended the "Death to America" chants but said they are aimed at America's leaders and not its people.
The Iranian people "will not stop saying 'Death to America' as long as the US acts maliciously" toward Iran, Khamenei said, referring to US President Donald Trump's State of the Union address in which he, among other things, said: "We will not avert our eyes from a regime that chants death to America."
Iran 'will not ask for permission' to develop missilesIranian President Hassan Rouhani said that Iran was determined to expand its military power and ballistic missile program despite mounting pressure from hostile countries to curb Iran's defensive work, state TV reported.
Read more: Missile test: Did Iran backstab the EU?
"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," Rouhani said in a speech at Freedom Square.
Iran's current supreme leader Ayatollah Ali Khamenei is due to publish "a detailed statement explaining the 'second step' of the progress of the Islamic revolution," his official website said.
Not all Iranians celebratingDespite the hundreds of thousands of people who took to the streets for the 40th anniversary, DW's Persian service chief Jamshid Barzegar said the large turnout at the state supported event was not enough to say that Iranians are celebrating.
"[Iranians] are facing different problems — a wide range of problems — from environmental problems to rising prices, inflation and food shortages," Barzegar said. "For instance, right now while we are talking, Iranian people are having problems to get meat, it's a crisis currently, so it's difficult to say, but based on what we can see on social media many are really disappointed and are not celebrating the anniversary as the government does."
DW's Iran correspondent Theresa Tropper visited a 24/7 pharmacy in the southwest of the capital where people were hoping to find desperately needed imported medication.
There are shortages for many western medicines such as heart conditions, Parkinson's disease and mental illnesses, largely due to US sanctions.
One woman was looking for medication for her mother who has a life threatening heart condition and told Tropper that every time she visited the 24/7 pharmacy they told her they didn't have it and were short of medicine.
"So where should we get it from? What should we do? When you can't even get the most vital heart medication how does this country expect to keep going. If this 24/7 pharmacy doesn’t have it, normal pharmacies definitely won't have it," she said.
Trading humanitarian goods like medicine is permitted under US sanctions but harsh banking restrictions and the fear of secondary sanctions prevent many foreign companies from doing business with Iran — something the EU is trying to change with its trading system INSTEX.
law/rt (AF, AP, Reuters)
Every evening at 1830 UTC, DW's editors send out a selection of the day's hard news and quality feature journalism. You can sign up to receive it directly here.