In Iran's account, the missile operator had 10 seconds to decide whether the plane was a threat. The decision was made. And a surface-to-air missile streaked toward the passenger jet.

Iran’s admission Saturday that “human error” brought down Ukrainian International Airlines Flight 752 added fresh details to what Western officials had concluded — a missile was to blame for Wednesday’s disaster that left all 176 people aboard the Kyiv-bound flight dead.

What comes next is how Iran will respond to demands to allow a full and open investigation and for authorities in Tehran to bring the perpetrators to justice. Pressure was not just from Ukraine and other nations whose citizens were aboard the Boeing 737-800.

Protests flared on the streets of Tehran, where apparent student-led rallies decried the missile mistake and chanted rare denunciations against military chiefs: “Resign, resign, resign.”

Iranian officials said military personnel targeted the plane as it turned toward a “sensitive military site” shortly after departing Tehran’s international airport before dawn.

The statement was a stunning about-face for Iran after days of rejecting Western assertions that a surface-to-air missile brought down the plane.

Now, leaders in Tehran face new challenges.

Ukraine has led demands for compensation and accountability, which could force Iran to appease the international community with a rare public reckoning over a military action. Iran’s supreme leader, Ayatollah Ali Khamenei, urged the nation’s military to conduct a thorough inquiry.

At home, the tragedy quickly brought protests back onto the streets in another show of anger. In November, protests erupted around the country after an increase in gasoline prices, leading to deadly clashes with security forces.

Many Iranians on the plane were students in Iran or studying abroad in Canada. Campuses in Iran became a gathering place for grief and rage.

At a vigil Saturday at Sharif University of Technology in Tehran, crowds chanted “down, down, Khamenei.” At Amirkabir University of Technology, a crowd yelled slogans against Iran’s powerful Revolutionary Guard Corps — a dramatic contrast to the widespread mourning after a U.S. drone strike in Iraq killed the leader of the Revolutionary Guard’s Quds Force, Maj. Gen. Qasem Soleimani.

Iran struck back for Soleimani’s death with ballistic missiles against an Iraqi base with U.S. personnel four hours before the Ukrainian plane burst into a fireball.

President Trump, in a tweet also posted in Farsi, addressed the “brave, long-suffering people of Iran.”

“We are following your protests, and are inspired by your courage,” he wrote.

In Tehran, Britain’s ambassador to Iran, Robert Macaire, was detained by Iranian security forces after attending what was planned as a “vigil” for those who died in the crash. Macaire left when protests broke out, according to an official familiar with the incident who spoke on the condition of anonymity to discuss a sensitive diplomatic matter. Iran’s Tasnim news agency reported that Macaire was held for more than an hour before being released.

Britain’s foreign secretary, Dominic Raab, denounced it as a “flagrant violation of international law.”

“The Iranian government is at a cross-roads moment,” Raab said. “It can continue its march towards pariah status with all the political and economic isolation that entails, or take steps to deescalate tensions and engage in a diplomatic path forwards.”

The General Staff of Iran’s Armed Forces apologized for what it said was “human error that caused the crash” of the Boeing 737-800.

Iran’s foreign minister, Mohammad Javad Zarif, offered “profound regrets, apologies and condolences.” But he also appeared to link the missile launch and the hyper-tense atmosphere in the region.

“Human error at time of crisis caused by U.S. adventurism led to disaster,” he tweeted, adding a red broken-heart emoji.

Gen. Amir Ali Hajizadeh, head of the Revolutionary Guard’s aerospace division, said the unit accepted responsibility for the shoot-down, describing a communication breakdown and a missile operator who had 10 seconds to decide whether the passenger jet was a threat.

“I wish I was dead,” Hajizadeh said on state TV about his first reaction when told about the missile mistake.

On Jan. 11, Iranian officials said the military brought down UIA 752 and said the investigation into who was responsible for the mistake must continue. (The Washington Post)

Ukrainian President Volodymyr Zelensky said he expected Iran “to bring those responsible to justice.”

“This morning was not good, but it brought the truth,” Zelensky wrote on Facebook.

Later, he said that Iranian President Hassan Rouhani agreed on “full legal and technical cooperation, including compensation.”

“We agreed,” Zelensky said in a videotaped message, “that no one would slip away” from the investigation into the missile firing.

In a separate statement, Rouhani called the missile launch an “unforgivable mistake,” and he said officials must “address the weaknesses of the nation’s defense systems to make sure such a disaster is never repeated.”

For Iran, the incident brought the flip side to a similar tragedy. In 1988, the U.S. guided-missile cruiser USS Vincennes fired a surface-to-air missile that mistakenly brought down an Iran Air passenger jet over the Persian Gulf, killing all 290 people aboard.

With the Iowa caucuses and New Hampshire primary approaching, an international crisis gave the race for the democratic presidential nomination a new urgency. (The Washington Post)

In a televised news conference, Hajizadeh said defense systems were “on their highest level of alert” that morning following Trump’s threats to strike 52 sites across Iran — and that additional defense batteries had been stationed around Tehran.

He said authorities interviewed the individual operator of the antiaircraft system that brought down the plane.

“His communication system was disrupted,” Hajizadeh said. “He had 10 seconds to decide whether to shoot or not.”

Hajizadeh said Saturday that the Civil Aviation Authority should not be blamed: “All of the responsibility is with us.”

The flight was mostly Iranians, Canadians and Ukrainians, and 138 of the passengers were headed to Toronto. Canadian Prime Minister Justin Trudeau said in a statement that the downing was “a national tragedy.”

Trudeau — after a call with Rouhani — said there still needs to be a “full and complete investigation” and possible compensation for the families of the victims needs “to be part of the mix.”

Iran’s admission, however, is an “important step,” Trudeau told reporters.

On Facebook on Saturday, the director of Ukraine International Airlines, Evgeny Dykhne, said, “We didn’t doubt for one second that our crew and our plane could not cause this terrible plane crash.”

Zelensky’s office put out photos Saturday of shrapnel damage on the plane, an indication the Ukrainians had evidence that might have pushed Iran into its public admission.

Oleksiy Danilov, secretary of Ukraine’s National Security and Defense Council, said Ukrainian investigators quickly determined a missile strike brought down the plane.

“We came to this conclusion before the Americans and Canadians,” Danilov told The Washington Post. “Because we were working there — there are no Americans and Canadians there. There are our experts who confirmed our fears that it happened in this particular way.”

“Look,” he added, “we have people working in Iran. You want us to say this so that they kicked our people out, that we weren’t able to work there?”

Still, Ukrainian authorities could face questions over the decision to allow the airliner to take off despite the threat from Iranian missiles.

More than two hours before the flight took off, the U.S. Federal Aviation Administration issued a notice prohibiting American carriers and commercial operators from flying in the airspace over Baghdad, the Persian Gulf and Gulf of Oman.

Ukraine’s aviation authorities did not issue a similar notice for its carriers at the time — nor did Iran’s Civil Aviation Organization close the airspace over the country. At least three other aircraft were in flight near Tehran at the time of the downing, according to civil aviation monitors.

Ukrainian authorities came under criticism in 2014 for their failure to close the airspace over the conflict zones of Donetsk and Luhansk after the July 2014 downing of Malaysia Airlines Flight 17.

That passenger airliner was downed by a missile shot from a Russian-made Buk surface-to-air missile system from rebel territory in eastern Ukraine. The attack on the Boeing 777, which was passing over the conflict region while flying from Amsterdam to Kuala Lumpur, killed all 298 people aboard.

A joint investigative team from Australia, Belgium, Malaysia, the Netherlands and Ukraine identified a Russian military unit in charge of the antiaircraft missile system and has pursued prosecution of Russian and Ukrainian citizens allegedly involved. But Russia has continued to deny involvement in the incident.

Khurshudyan reported from Moscow. David L. Stern in Kyiv and Paul Sonne and Carol Morello in Washington contributed to this report.