Mourners packed the streets of the Iranian capital Tehran for the funeral of the slain Iranian military commander Qasem Soleimani.
Soleimani was assassinated in a US drone strike in Iraq on Friday on the orders of President Donald Trump.
Iran’s supreme leader Ayatollah Khamenei led prayers and at one point was seen weeping.
Iran has vowed “severe revenge” for the death of Soleimani and on Sunday pulled back from the 2015 nuclear accord.
Soleimani, 62, spearheaded Iranian military operations in the Middle East, and was regarded as a terrorist by the US.
President Trump said Soleimani was plotting “imminent” attacks on US diplomats and military personnel in Iraq and elsewhere in the region.
What happened at Soleimani’s funeral?
State television showed huge crowds in Tehran for the event. Soleimani was hailed as a national hero and widely considered the second most powerful man in the country behind Supreme Leader Khamenei.
People cried while others clutched pictures of the late commander. Mourners passed his coffin over their heads and “death to America” chants were heard.
His daughter Zeinab Soleimani warned the US it faces a “dark day” for the killing. “Crazy Trump, don’t think that everything is over with my father’s martyrdom,” she said.
Following Monday’s funeral, the general’s remains will then be taken to Qom, one of the centres of Shia Islam, for a ceremony ahead of a burial in his hometown of Kerman on Tuesday.
When visiting Soleimani’s family members at their house in Tehran, President Rouhani said: “The Americans really did not realise what grave error they have committed.
“Revenge for his blood will be exacted on that day when the filthy hands of America will be cut off forever from the region.”
How has Iran responded to the killing?
On Sunday Iran declared it would no longer abide by any of the restrictions imposed by the 2015 nuclear deal.
The deal limited Iranian nuclear capacities in exchange for the lifting of economic sanctions.
But in a statement, Iran said it would no longer observe limitations on its capacity for enrichment, the level of enrichment, the stock of enriched material, or research and development.
Three European parties to the deal – Germany, France and the UK – urged Iran to abide by its terms.
Also on Sunday, Iraqi MPs passed a non-binding resolution calling for foreign troops to leave. US forces were invited to return to Iraq to help defeat the Islamic State group.
The new head of Iran’s Quds force – which Soleimani led – has vowed to expel the US from the Middle East.
How has Trump reacted?
Following warnings from Iran, Mr Trump said that the US would respond in the event of retaliation for Soleimani’s death, “perhaps in a disproportionate manner”.
He said the US was ready to hit 52 Iranian sites and would “strike very fast and very hard” if Tehran attacked Americans or US assets.
President Trump also threatened severe sanctions against Iraq if US troops left.
“We have a very extraordinarily expensive air base that’s there. It cost billions of dollars to build. We’re not leaving unless they pay us back for it,” he told reporters.