Iran marks 1979 embassy siege with 'Death to America'
Rallies also took place in several other cities four decades to the day after revolutionary students stormed the complex and seized dozens of American diplomats and embassy staff - an event that still strains ties.
"They will continue their enmity against us. They are like a lethal scorpion whose nature is to have a poisonous sting," the head of the army, General Abdolrahim Mousavi, said in a speech at Tehran.
"We are ready to crush this scorpion and will also pay the price."
He slammed the idea of interacting with the United States as a ruse, echoing recent remarks by Iran's supreme leader Ayatollah Ali Khamenei.
Words like negotiation are a "gift wrapping ... hiding the discourse of submission and defeat", Mousavi said, adding that the only way forward is "to maintain the revolutionary spirit through prudence and obeying the leader".
Replica missiles and the same type of air defence battery used to shoot down a US drone in June were put on display outside the former embassy turned museum in Tehran.
'Death to America'
Iranians massed in front of the building carrying placards with slogans such as "Down with USA" and "Death to America", according to AFP journalists at the scene.
Rallies were also reported in the cities of Mashhad, Shiraz and Esfahan, among others, with the Mehr news agency estimating "millions of people" attended across the country, though it was not possible to verify that figure.
State TV aired segments of a Canadian documentary titled "The Fire Breather" showing Trump's controversial 2016 campaign trail highlights and biting comments about his past alongside images of the rallies.
On 4 November 1979, less than nine months after the toppling of Iran's American-backed shah, students overran the embassy complex to demand the United States hand over the ousted ruler after he was admitted to a US hospital.
It took 444 days for the crisis to end with the release of 52 Americans, but the US broke off diplomatic relations with Iran in 1980 and ties have been frozen ever since.
The 40th anniversary comes at a time of escalating tensions between Tehran and Washington and also the region.
"This may be the best time to say 'Down with the US'," said a state TV reporter at the rally.
People behind her held yellow placards saying "The illusion of US return to Iran cannot be realised," referring to Khamenei's Sunday speech which warned against Washington gaining a foothold.
|America's problem is still this sense of exceptionalism. It allows itself to trample international law and commit the worst crimes against nations with no fear of an international backlash
- Ali Rabiei, government spokesman
According to the Mehr news agency, "the documents found (inside the US embassy in 1979) proved revolutionary students' claim that Washington was using the building to plot" against the nascent Islamic Republic.
Trump withdrew the US from a landmark 2015 nuclear deal between Iran and world powers last year and reimposed punishing sanctions.
Tehran has hit back with three countermeasures since May reducing parts of its compliance with the deal.
"Americans, at the time (of the embassy takeover) believed they were an exceptional nation, able to commit any injustice anywhere," government spokesman Ali Rabiei told the press on Monday.
"America's problem is still this sense of exceptionalism. It allows itself to trample international law and commit the worst crimes against nations with no fear of an international backlash," he added.
The arch-foes came to the brink of a military confrontation in June when Iran downed a US Global Hawk drone and Trump ordered retaliatory strikes before cancelling them at the last minute.
Iran unveiled new anti-American murals on the walls of the former embassy on Saturday with stark images of a crumbling Statue of Liberty, a downed US drone and skulls floating in a sea of blood.
Forty years later, the hostage crisis continues to poison relations between Iran and the US.
American academic Gary Sick, who was on the US National Security Council at the time, told AFP in Washington that the crisis is "probably the single best explanation for why we're in the sort of impasse we are right now".