Iran said Saturday it "unintentionally" shot down a Ukrainian passenger jet, killing all 176 people aboard, in an abrupt about-turn after initially denying Western claims it was struck by a missile.
President Hassan Rouhani said a military probe into the tragedy had found "missiles fired due to human error" brought down the Boeing 737, calling it an "unforgivable mistake".
Supreme leader Ayatollah Ali Khamenei offered his condolences and ordered the armed forces to address "shortcomings" so that such a disaster does not happen again.
The acknowledgement came after officials in Iran had for days categorically denied Western claims that the Ukraine International Airlines plane had been struck by a missile in a catastrophic error.
The jet, which had been bound for Kiev, slammed into a field shortly after taking off from Tehran's Imam Khomeini International Airport before dawn on Wednesday.
It came only hours after Iran launched a wave of missiles at bases hosting American forces in Iraq in response to the killing of top Iranian general Qasem Soleimani in a US drone strike.
The aerospace commander of Iran's Revolutionary Guards accepted full responsibility.
But Brigadier General Amirali Hajizadeh said the missile operator acted independently, shooting down the Boeing 737 after mistaking it for a "cruise missile".
The operator failed to obtain approval from his superiors because of disruptions to his communications system, he said.
"He had 10 seconds to decide. He could have decided to strike or not to strike and under such circumstances he took the wrong decision."
"It was a short-range missile that exploded next to the plane," Hajizadeh added.
Iran had come under mounting international pressure to allow a "credible" investigation after video footage emerged appearing to show the plane being hit by a fast-moving object before a flash appears.
- 'Hostile target' -
Ukraine, Canada, Sweden and Afghanistan called for accountability after Iran's admission.
British Prime Minister Boris Johnston said Iran's acknowledgement was an "important first step".
The military was first to admit the error, saying the aircraft had been mistaken for a "hostile target".
It said Iran had been at the highest level of alert after American "threats" and that the plane had turned and come close to a "sensitive" military site before it was hit due to "human error".
Rouhani said Iran had been on alert for possible US attacks after Soleimani's "martyrdom".
"Iran is very much saddened by this catastrophic mistake and I, on behalf of the Islamic Republic of Iran, express my deep condolences to the families of victims of this painful catastrophe," the president said.
Rouhani added he had ordered "all relevant bodies to take all necessary actions (to ensure) compensation" to the families of those killed.
"The perpetrators of this unforgivable mistake will be prosecuted."
The majority of passengers on the flight PS752 were dual national Iranian-Canadians but also included Ukrainians, Afghans, Britons and Swedes.
- Calls for transparency -
Ukrainian President Volodymyr Zelensky demanded Iran punish those responsible for the downing of the plane and pay compensation.
"We expect Iran... to bring the guilty to the courts," he said on Facebook, before his office announced he would speak later on the phone with Rouhani.
Canadian Prime Minister Justin Trudeau demanded "transparency, and justice for the families and loved ones of the victims".
"This is a national tragedy, and all Canadians are mourning together."
Sweden demanded a "complete and transparent probe" while Afghanistan said families of 13 of its citizens killed in the tragedy "deserve answers".
The disaster came as tensions soared in the region after Soleimani's killing, and fears grew of an all-out war between Iran and its arch-enemy the United States.
Washington said the Soleimani strike was carried out to prevent "imminent", large-scale attacks on American embassies.
Tehran had vowed "severe revenge" for his killing before launching missiles at the bases in Iraq.
Iran has invited the United States, Ukraine, Canada and others to join the crash investigation.
It is Iran's worst civil aviation disaster since 1988 when the US military said it shot down an Iran Air plane over the Gulf by mistake, killing all 290 people on board.
Video footage of Wednesday's incident, which The New York Times said it had verified, appeared to show the moment the airliner was hit.
A fast-moving object is seen rising at an angle into the sky before a bright flash appears, which dims and then continues moving forward. Several seconds later, an explosion is heard and the sky lights up.
Nations around the world have called for restraint and de-escalation, and fears of a full-blown conflict have subsided after US President Donald Trump said Iran appeared to be standing down after targeting the US bases in Iraq.