DUBAI (Reuters) -- Iran said on Saturday its military had mistakenly shot down a Ukrainian plane killing all 176 aboard, saying air defenses were fired in error while on alert in the tense aftermath of Iranian missile strikes on U.S. targets in Iraq.
Iran had denied for days after Wednesday's crash that it brought down the plane, although a top Revolutionary Guards commander said on Saturday that he had informed the authorities about the unintentional missile strike the same day it happened.
Supreme Leader Ali Khamenei, who until Saturday had kept silent about the crash, said information should be made public, while top officials and the military issued apologies.
But state television suggested revealing the truth about what happened might be used by "enemies of Iran," usually a reference to the United States and Israel.
The crash heightened international pressure on Iran after months of friction with the United States and tit-for-tat attacks. A U.S. drone strike had killed a top Iranian military commander in Iraq on Jan. 3, prompting Tehran to fire at U.S. targets on Wednesday.
Canada, which had 57 citizens on board, and the United States had both said they believed an Iranian missile brought down the aircraft, although they said it was probably an error.
"The Islamic Republic of Iran deeply regrets this disastrous mistake," Iranian President Hassan Rouhani wrote on Twitter, promising that those behind the incident would be prosecuted. "My thoughts and prayers go to all the mourning families."
Experts said mounting international scrutiny would have made it all but impossible to hide signs of a missile strike in any investigation and Iran may have felt a U-turn was better than battling rising criticism abroad and growing grief and anger at home, as many victims were Iranians with dual nationality.
In Twitter messages, angry Iranians asked why the plane was allowed to take off with tensions in Iran so high. The plane came down when Tehran was alert for U.S. reprisals in the hours after Iran launched rockets at U.S. troops in Iraqi bases.
Iran's Revolutionary Guards, in a rare admission of error, apologized to the nation and accepted full responsibility.
Senior Guards commander Amirali Hajizadeh said he had informed Iran's authorities on Wednesday about the unintentional strike, a comment that raised questions about why officials had publicly denied it for so long.
Speaking on state television, he said he wished "I could die" when he heard the news about the incident.
Responding to Iran's announcement on Saturday, Ukraine demanded an official apology and compensation. Canadian Prime Minister Justin Trudeau called for "a complete and thorough investigation" with Iran's full cooperation.
Iranian Foreign Minister Mohammad Javad Zarif wrote on Twitter that "human error at time of crisis caused by U.S. adventurism led to disaster," citing an initial armed forces investigation into the crash of the Boeing 737-800.
A military statement said the plane flew close to a sensitive Revolutionary Guards site a time of high alert, although Ukraine said the plane was in a normal flight corridor.
Ukraine International Airlines said Iran should have closed the airport. Its vice president said the carrier received no indication it faced a threat and was cleared for take off.
Aviation experts said it is up to a country to close its airspace when there is a risk.
Kiev and Paris agreed on Saturday that French specialists would help decode the black boxes, the office of Ukrainian President Volodymyr Zelenskiy said. The French air accident agency analyzed data from a Boeing crash in Ethiopia last year.
Iran has said it would download information from the voice and flight data recorders itself but would seek help if needed.
Analysts said a probe would almost certainly have revealed signs on the smashed fuselage of a missile strike.
"There's nothing you can do to cover it up or hide it," said Anthony Brickhouse, an air safety expert at Embry-Riddle Aeronautical University and former U.S. National Transportation Safety Board investigator. "Evidence is evidence."
The White House did not immediately respond to a request for comment on Saturday's announcement by Iran.
Mobile phone footage posted and circulated by ordinary Iranians on Twitter after the crash indicated the plane came down in flames and exploded as it struck the ground.
Grief-stricken Iranians complained on social media that Iran's authorities had spent more time fending off criticism than sympathizing with victims' families.
"Why were any civilian airlines flying out of Tehran airport in those conditions?" Twitter user Shiva Balaghi wrote.
A U.S. official said data showed the plane was airborne for two minutes after departing Tehran when heat signatures of two surface-to-air missiles were detected. There was an explosion in the vicinity and heat data showed the plane on fire as it fell. U.S. military satellites detect infrared emissions from heat.
The disaster echoed of a 1988 incident, when a U.S. warship shot down an Iranian airliner, killing 290 people. Washington said it was an accident. Tehran said it was intentional.