The three Israeli hostages who were killed by Israeli forces in Gaza on Friday had emerged shirtless from a building and were bearing a makeshift white flag when they were shot, the military said on Saturday.

The troubling details of how they died have created widespread anguish in Israel and prompted renewed calls for another temporary truce and a deal to allow more hostages to be released. Lt. Gen. Herzi Halevy, the Israeli military chief of staff, said the three hostages had done “everything so that we would understand” that they were harmless, including removing their shirts to show they bore no explosives.

Nonetheless, Israeli troops shot and killed them, in an incident that shocked a country already deeply concerned about the fate of its remaining hostages in Gaza. He said the shooting violated the military’s rules of engagement.

“It is forbidden to shoot at those who raise a white flag and seek to surrender,” General Halevy said, adding, “The Israel Defense Forces, and myself as its commander, are responsible for what happened.”

Protesters in Tel Aviv and relatives of hostages expressed anger over the killings and pressed the government to focus on reaching another hostage-for-prisoners deal with Hamas rather than continuing a full-scale offensive in Gaza.

With outrage growing, Prime Minister Benjamin Netanyahu addressed the nation late Saturday on television, expressing empathy for the families of the slain hostages. “It broke my heart,” he said. “It broke the entire country’s heart.”

But he made clear he would not scale back or halt the air and ground campaigns. He cast the conflict as “a war for our existence” and argued that maintaining military action was necessary to persuade Hamas to release more hostages.

“With all of the deep sorrow, I would like to clarify: The military pressure is essential both for returning the hostages and achieving victory over our enemies,” he said.

The Israeli military announced the accidental killings on Friday, hours after saying it had recovered the bodies of three other Israeli hostages in Gaza. The deaths underscore the continuing risks for the more than 120 people who Israel says remain in captivity after being kidnapped during the Hamas attack on Israel on Oct. 7.

In a written statement describing the results of a preliminary inquiry, the Israeli military said its soldiers had been operating in Shejaiye, an area of Gaza City that has seen intense fighting. Earlier this week, at least nine Israeli soldiers were killed during battles in the neighborhood as the military sought to root out Palestinian militants there.

On Friday, the soldiers were on high alert for attempts by Hamas to ambush Israeli forces, possibly in civilian clothes, as they patrolled the area, the military said.

The three hostages emerged, shirtless, from a building tens of yards away from the Israeli soldiers, bearing a stick with a white cloth, the military said its preliminary investigation found. One of the soldiers, believing they posed a threat, opened fire on the three hostages, killing two of them and wounding the third, the early investigation found.

The third hostage fled into the building, from which a cry in Hebrew for help could be heard. The battalion commander ordered the forces to hold their fire. But the wounded hostage later re-emerged, after which he was fatally shot, the military statement said.

In a briefing with reporters, an Israeli military official, speaking on the condition of anonymity under military protocol, said the hostages may have escaped or have been abandoned by their captors.

The military identified the three men killed on Friday as Yotam Haim and Alon Shamriz, both taken from Kibbutz Kfar Aza, and Samer Talalka, who had been kidnapped from Kibbutz Nir Am, all in southern Israel near the Gaza border.

“This is a sad and painful incident for all of us,” Rear Adm. Daniel Hagari, the chief spokesman for the Israeli military, said on Friday. He vowed “full transparency” as the military investigates how the tragedy unfolded, and said the Israel Defense Forces bore “responsibility for everything that happened.”

Victoria Kim contributed reporting.