The Israeli military is investigating an airstrike which targeted a Palestinian home in Gaza, killing eight people, including five children, after defence sources admitted they mistakenly thought the building was empty.

Avichay Adraee, a military spokesperson initially said that the strike took out “Rasmi Abu Malhous”, an Islamic Jihad commander in the centre of the 25-mile-long enclave. He included a photo of the militant, clad in camouflage.

But local journalists and neighbours in Deir al-Balah, where the strike took place, claimed the family were impoverished shepherds.

They said that the man who died in the strike did not resemble the photo shared by Israeli forces. The brother of an Islamic Jihad commander had been killed, they said.

Israeli defence sources later admitted to the Haaretz newspaper that they had made a mistake in targeting the building, which they had thought would be empty.

The Israeli military told The Independent that intelligence gathered ahead of the strike pointed to no civilian presence. And it confirmed it had opened up an investigation into the incident.

“Israel targeted Islamic Jihad military infrastructure in Deir al-Balah. According to the information available to the [Israeli army] at the time of the strike, no civilians were expected to be harmed as a result these strikes,” a spokesperson said.

“The [Israeli military] is investigating the harm caused to civilians by the strike,” she added.

A shaky ceasefire between Islamic Jihad fighters in Gaza and the Israeli military tentatively held on Friday, broken in part by a few barrages of rocket fire and retaliatory Israeli airstrikes.

The Egypt-brokered truce had ended two days of fierce cross-border fighting, triggered on Tuesday by Israel’s targeted killing of Islamic Jihad northern commander Baha Abu al-Ata, whom they said was planning “imminent” attacks on southern Israel.

In retaliation, Islamic Jihad fired back with more than 450 rockets, which pounded areas from the south of the country to the commercial capital Tel Aviv.

Israel responded with further airstrikes on the besieged strip.

At least 34 Palestinians were killed, including eight children and three women, and more than 100 wounded in Israeli raids.

Three Israelis were lightly wounded by rocket fire, which bought swathes of the country to a standstill.

Israel targeted the building in Deir al-Balah just hours before the ceasefire came into force.

The Gaza health ministry listed the dead as Rasmi Abu Malhous, 45, of the al-Sawarka tribe; two women, Maria, 35, and Yosra, 39; as well as five children, aged seven, 12, 13, three and two years old.

In Deir al-Balah, neighbours speaking on the condition of anonymity said that Rasmi Abu Malhous was the brother of an Islamic Jihad commander and did not resemble the photo shared by the Israeli spokesperson.

They told the Associated Press that Rasmi had not been involved in any fighting and was killed along with his wife and his brother’s wife, as well as his and his brother’s children.

Local journalist Sanad Latifa, who was at the scene, told The Independent that the home did not appear to belong to a powerful commander but was located in a rundown area populated by herding communities.

“They are a Bedouin family, living in an isolated agriculture area. The place looks horrible,” he said.

“All that is left is a hole four meters deep scattered with a few belongings. You cannot even recognise what kind of building used to be there, it was completely obliterated,” he added.

He said volunteers and emergency workers had to dig through the dirt to pull the bodies of the children out.

“We understand that the Islamic Jihad commander was not present, but he may have been part of the family,” he added.

Photos of the funeral showed the bodies fully wrapped in cloth obscuring the faces.

We understand that the Islamic Jihad commander was not present, but he may have been part of the family Sanad Latifa, Palestinian journalist in Deir al-Balah

Three of them are wrapped in the black flag of the Islamic Jihad group. However, four were covered in the yellow flag of rival political group Fatah, which runs the Palestinian Authority, anchored in the West Bank.

Islamic Jihad has not commented on the strike.

Omar Shakir, a director of Human Rights Watch, said such airstrikes can be permissible under international law, depending on the threat posed by the target and whether the damage to civilians is “proportional” to the military gain.

“Too often civilians pay the price for political brinkmanship by states and armed groups,” he told the Associated Press. “We’ve seen several rounds of fighting now in Gaza where civilians have lost their lives or had their property damaged and faced harrowing circumstances as the result of unlawful attacks by both parties.”

Israel and militants in Gaza have teetered on the brink of war a number of times over the past year but have yet to hammer out a long-term ceasefire.