In war, nobody wants to be the last to die. In Gaza, it was the chief of the electric company’s maintenance division and his deputy. In Israel, it was a pair of volunteers working a security detail on their kibbutz.

The four deaths on Tuesday, hours before an open-ended cease-fire began between Israel and Hamas, reflected the often indiscriminate, opaque and lethal nature of a conflict that dragged on for 50 days and more than 2,100 deaths, only to end where it began, with a truce deal that is essentially a retread of the one signed in 2012 after the last Gaza war.

The cease-fire was still holding Wednesday, and that was good news in a conflict beset by breaches by Hamas and the other militant resistance groups operating in the Gaza Strip.

Israeli drones could still be heard flying circles overhead, but there was no rocket or missile fire. In Gaza, fishermen went further out to sea than they have in years, and farmers were allowed to work fields close to the Israel fence line.

Prime Minister Benjamin Netanyahu said Wednesday that Israel had dealt Hamas “the greatest blow since the organization’s founding.” But in Gaza, Ismail Haniyeh, the Hamas leader there, praised the 1.8 million residents of Gaza as “the true heroes.” It was Haniyeh’s first public appearance since the war began seven weeks ago.

U.N. agencies report that 2,104 Palestinians were killed in the Gaza hostilities, including 495 children and 253 women. Sixty-nine Israelis were killed — 64 soldiers and five civilians. A guest worker from Thailand also was killed in Israel.

Among those who perished in the final hours, Mohammad Daher, a 49-year-old Palestinian, was a chief of maintenance in the northern district for Gaza Electricity Distribution Corp., where he had worked since 1991.

He was driving in his company pickup truck when eyewitnesses say a missile fired from an Israeli drone struck the vehicle, instantly killing Daher and his 27-year-old deputy, Tamir Hamad, who was driving.

“They wouldn’t even let me see his body in the morgue. He was just pieces,” said his brother Raed Daher, a Gaza policeman who worked for the Palestinian Authority in Ramallah, not for Hamas.

“I could recognize his shoes,” he said.

Israel’s senior military spokesman, Lt. Col Peter Lerner, said that the truck was identified as “escaping the scene of a rocket launch.”

Mohammad Daher was no militant, his family said.

“He worked two shifts a day, morning and night,” his brother said. “It was a dangerous job. They worked while the Israelis were shelling them. He kept the lights on.”

Why was his truck targeted? His brothers said the four-door Toyota was clearly marked with the logo of the electric company and flying a company flag, which sports a red lightning bolt.

“He was killed because he was a Palestinian,” his brother said. “He was a father and a grandfather. He was an old guy. He didn’t have a gun or a jet plane.”

Jamal Dardasawi, a public information officer for the Gaza electricity company, told the Palestinian news agency Maan that he believed the work truck was deliberately targeted. Daher and his extended family are Fatah loyalists, members not of Hamas but the party led by Palestinian Authority President Mahmoud Abbas.

Inside Israel, a few hours after Daher was killed, a dozen mortar rounds from Gaza rained down on a kibbutz called Nirim.

It was just an hour before the cease-fire began. Shahar Melamed, 43, and Zeevik Etzion, 55, were outside repairing an electricity line damaged by an attack earlier that day.

Etzion, a father of five, headed the community’s security detail and Melamed, a father of three, volunteered as his deputy. He was also responsible for irrigation of the kibbutz crops. The two men died in the mortar barrage.

“Everyone here is in great pain after what happened yesterday,” said Dedy Rubenstein, who runs an agricultural cooperative for farming communities in the south. “We have not started mourning for them yet. Everyone is too busy making the preparations for their funerals.”

“This is a very intimate community, we are all very close and know each other very well,” said Rubenstein, adding that this quiet kibbutz of only 380 members was also now struggling with all the media attention.

Rubenstein said the fact the two were killed just before the cease-fire went into effect was irrelevant. “It only takes a second for this to happen and it does not matter if it happens during the first day or the last day,” he said.

More than half the kibbutz residents, particularly those with young children, had fled their homes during the 50 days of fighting between Israel and Hamas.

“The last four days was literally a battlefield here, not a place for kids,” said Rubenstein, describing constant code red sirens, rockets falling and mortar shells being fired at the kibbutz. “Only those that had to work, manage the animals and tend to the fields stayed here. The others left.”

“The other side tried to destroy us, they tried to make us leave,” said Rubenstein, referring to Hamas. “But we are committed to staying here, this is our home, we won’t leave.”

From each side on Wednesday, Israeli and Palestinian leaders competed to claim that their side had won.

Speaking at a news conference in Jerusalem, Netanyahu said Israel had achieved a great political and military success.

“A thousand Hamas terrorists were killed, many of them commanders,’’ Netanyahu said.”Thousands of rocket arsenals, launch sites and weapons caches were destroyed along with hundreds of command centers.’’

Instead of the triumph claimed by Hamas leaders and militants, the Israeli prime minister stressed that Hamas and the Palestinians had won nothing.

“They demanded a seaport and did not achieve this; they demanded an airport and did not achieve this; they demanded the release of prisoners placed back under arrest following the murder of the three Israeli boys; they demanded monetary compensation and salaries which they did not receive; they demanded that negotiations be conducted by Turkey or Qatar and this they did not get,” Netanyahu said.

Haniyeh, the Hamas leader, delivered his speech in the Shijaiyah neighborhood in east Gaza City, which now was in ruins after serving as the front lines during the Israeli ground offensive. Haniyeh promised, “this victory will lead the way to Jerusalem.”

During his speech, burly fighters dressed in black, their faces masked, from the Hamas military wing, the Izzedine al-Qassam Brigades, milled in the crowd. They were brandishing weapons and posing for photos with children.

Eglash reported from Nirim. Hazem Balousha in Gaza contributed to this report.