Latest developments:

Canadian Prime Minister Justin Trudeau calls for credible investigation and compensation for families .

Iran's president says his country regrets 'this disastrous mistake.'

Iran's Supreme Leader Ayatollah Khamenei expresses his 'deep sympathy' to families of the victims.

Iranians protest in Tehran, with some demanding Khamenei step down.

Iran announced Saturday that its military "unintentionally" shot down the Ukrainian jetliner that crashed earlier this week, killing all 176 aboard, after the government had repeatedly denied Western accusations that it was responsible.

The Kyiv-bound plane was shot down early Wednesday, hours after Iran launched a ballistic missile attack on two military bases housing U.S. troops in Iraq in retaliation for the killing of Iranian Gen. Qassem Soleimani in an American airstrike in Baghdad. No one was wounded in the attack on the bases.

A military statement carried by state media said the plane was mistaken for a "hostile target" after it turned toward a "sensitive military centre" of Iran's Revolutionary Guard. The military was at its "highest level of readiness," it said, amid the heightened tensions with the United States.

An Iranian Revolutionary Guard commander said his unit accepts "full responsibility" for what happened. In an address broadcast by state TV on Saturday, Gen. Amir Ali Hajizadeh said that when he learned about the downing of the plane, "I wished I were dead."

"In such a condition, because of human error and in an unintentional way, the flight was hit," the military statement said. It apologized for the disaster and said it would upgrade its systems to prevent such "mistakes" in the future. It also said those responsible for the strike on the plane would be prosecuted.

Iranian Foreign Minister Javad Zarif on Twitter offered "profound regrets, apologies and condolences" to those affected, but also blamed "US adventurism" for the accident.

President Hassan Rouhani tweeted: "Iran deeply regrets this disastrous mistake."

The Islamic Republic of Iran deeply regrets this disastrous mistake.<br><br>My thoughts and prayers go to all the mourning families. I offer my sincerest condolences. <a href="https://t.co/4dkePxupzm">https://t.co/4dkePxupzm</a> —@HassanRouhani

Flight PS752, a Boeing 737 operated by Ukrainian International Airlines, went down on the outskirts of Tehran during takeoff. Ottawa said 138 people were bound for Canada. Foreign Affairs Minister François-Philippe Champagne on Friday said that 57 Canadians were killed.

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 told authorities about the unintentional missile strike the day it happened.

Trudeau wants credible investigation

Canadian Prime Minister Justin Trudeau on Saturday said he is "outraged" and "furious" over the downing, and said Iran must take full responsibility.

Trudeau, who spoke with Rouhani by phone, says the admission is a good first step, but many more steps must be taken.

He says accountability must include a credible investigation and compensation for the families of the dead.

A group of Iranian protesters gathered in Tehran on Saturday, demanding the country's Supreme Leader Ayatollah Ali Khamenei step down. Videos posted on Twitter showed hundreds of people chanting in front of Tehran's Amir Kabir university.

Iran's semi-official Fars News Agency is reporting that some of the demonstrators ripped up pictures of Soleimani, the Quds commander who was killed in a U.S. drone strike on Jan. 3 and has been idolized over the past week during mourning ceremonies.

WATCH | What Iran's admission on shooting down the plane may mean:

How will Iran retaliate against the United States after the assassination of Gen. Qassem Soleimani — and what does that mean for the Middle East? 10:45

Ottawa is leading a group of nations that lost citizens in the crash to advocate with "one single voice," Champagne said Friday.

The government is also creating a task force of top public servants to make sure Canadian families affected by the crash get the support and information they need, he added.

Champagne will be speaking about the investigation later Saturday. On Friday, he announced the creation of an international working group of countries, assembled to press the Iranian regime for a thorough investigation.

Rouhani spoke Saturday with Trudeau and said the investigation was progressing rapidly. His website quoted him accusing the United States of driving the situation in the Middle East to a "dangerous level" and said all involved should try to return "full stability and security" to the region.

A woman lays flowers at a makeshift memorial at the Boryspil airport outside Kyiv on Saturday to pay tribute to the victims of the Ukraine International Airlines Boeing 737-800 that crashed near the Iranian capital on Wednesday. On Saturday, Iran admitted it shot down the aircraft. (Sergei Supinsky/AFP via Getty Images)

The plane was en route to the Ukrainian capital of Kyiv when it went down. The dead also included citizens of Iran, Ukraine, Sweden, the United Kingdom, Afghanistan and Germany.

WATCH | Purported video of missile strike:

Christian Leuprecht, Queen's University political science professor, says Iran has signalled that it's co-operating on the plane crash probe, 'without actually co-operating.' 4:55

Iran's supreme leader has offered condolences and called for an investigation. In a statement broadcast on state TV on Saturday, Ayatollah Khamenei expressed his "deep sympathy" to the families of the victims and called on the armed forces to "pursue probable shortcomings and guilt in the painful incident."

France to help decode black boxes

Ukraine's President Volodymyr Zelensky issued a statement saying the crash investigation should continue and the "perpetrators" should be brought to justice. He said Iran should compensate victims' families, and he requested "official apologies through diplomatic channels."

Zelensky said on Saturday that he spoke to French President Emmanuel Macron and they agreed to have French specialists decode the plane's "black box" recorder. A spokesperson for Ukraine's leader on Friday said Ukrainian officials gained access to the recorder.

In a news conference on Saturday, the airline's President Evgeniy Dykhne said his company checked safety documents "multiple times" and was confident that there was "no opportunity for any technical problems or any kind of piloting mistakes" before the jet crashed outside Tehran.