Huge crowds have packed the streets of the Iranian capital Tehran for the funeral of 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, headed Iran's elite Quds Force, and was tasked with protecting and boosting Iran's influence in the Middle East.
He supported Syria's President Bashar al-Assad in the country's civil conflict, aided the Shia militant group Hezbollah in Lebanon, and guided Iraqi militia groups against the Islamic State group.
The US saw him as a terrorist, and President Trump said Soleimani was plotting "imminent" attacks on US diplomats and military personnel.
In Iran, Soleimani was hailed as a national hero and widely considered the second most powerful man in the country behind Supreme Leader Khamenei.
But not all Iranians are as distressed about the general's death as the mourners who lined Tehran's streets, says BBC Middle East Editor Jeremy Bowen.
Soleimani was a hardliner and a dominant force in a regime that shot dead scores of protesters at the end of 2019. He also spent vast sums building up alliances and militias in Lebanon, Yemen, Iraq and Syria at a time when US sanctions are impoverishing many Iranians, our correspondent says.
What happened at Soleimani's funeral?
State television showed huge crowds in Tehran for the event. It put the number who turned out as "millions" although this is yet to be verified.
Some people cried, while others clutched pictures of the late commander. Mourners passed Soleimani's coffin over their heads and "death to America" chants were heard.
His daughter Zeinab Soleimani warned the US that it faced a "dark day".
"Crazy Trump, don't think that everything is over with my father's martyrdom," she said.
Soleimani's remains were then taken to Qom, one of the centres of Shia Islam, where massive crowds also gathered for a ceremony.
The general will be buried in his hometown of Kerman on Tuesday.
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.
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 had been invited back to Iraq in 2014 to help defeat the Islamic State group, and there are about 5,000 in the country.
The new head of Iran's Quds force has vowed to expel the US from the Middle East.
Meanwhile, BBC security correspondent Frank Gardner says an Iranian official told him he backed a claim by Iraq's PM that Soleimani was carrying an Iranian response to a Saudi peace overture.
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 repeated a threat to target Iranian cultural sites, saying the US 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 airbase that's there. It cost billions of dollars to build. We're not leaving unless they pay us back for it," he told reporters.
The president on Monday also responded to Iran's decision to no longer abide by the nuclear deal, tweeting: "Iran will never have a nuclear weapon!"
How have others responded?
A number of political leaders across the world have called for restraint, including German Chancellor Angela Merkel, French President Emmanuel Macron and British Prime Minister Boris Johnson in a joint statement.
Nato's ruling council met on Monday to discuss the crisis and made a similar call. Secretary-General Jens Stoltenberg said Nato had suspended its training operations within Iraq as a precautionary measure to protect personnel.
He said the decision to kill Soleimani had been made by the US alone, but that all Nato members had shown "very strong unity" and expressed concerned about Iran's "destabilising actions in the region".
UN Secretary-General Antonio Guterres urged restraint, saying: "Geopolitical tensions are at their highest level this century."
Mrs Merkel will travel to Russia later this week for talks with President Vladimir Putin.
Markets have remained turbulent. Brent crude oil topped $70 (£53) a barrel on Monday for the first time since September.
Voices from Iran
The BBC's Persian service has been seeking the views of Iranians on Soleimani's killing.
"I believe Soleimani did not deserve such a fate. He did a lot for Iran, to protect this country. Our enemies have been attacking us for the past four decades and he tried to save the country," - Paniz (f)
"Soleimani was not a hero, in my opinion he was a soldier and overrated by the establishment. People are being too emotional about him," - Erfan (m)
What are Iran's key cultural sites?
The suggestion that the US could target Iranian cultural sites sparked alarm in Iran and beyond. Such action could be considered a war crime under international law.
Iran is home to two dozen Unesco World Heritage sites. These are sites that the UN's cultural organisation believes need preserving for their cultural, historic or scientific significance. These include:
- Persepolis, the sprawling ancient ruins which date back to 518 BC and were the site of the capital of the ancient Persian Achaemenid empire
- Naqsh-e Jahan Square in the city of Isfahan, which was built in the early 17th Century and is is one of the largest city squares in the world
- Golestan Palace in Tehran, the residence and seat of power for the Qajar dynasty which ruled Iran from 1785 to 1925
Do you have any questions about the assassination of Qasem Soleimani, the circumstances preceding it and the consequences?
In some cases your question will be published, displaying your name, age and location as you provide it, unless you state otherwise. Your contact details will never be published. Please ensure you have read the terms and conditions.
Use this form to ask your question: