An Israeli attack has killed two members of the Gaza Strip’s ruling Hamas movement after shots were fired at soldiers, officials in Gaza and Israel have said.

Hamas’s military wing, the Ezzedine al-Qassam Brigades, on Tuesday identified the dead Palestinians as Ahmed Murjan and Abdel-Hafez al-Silawi, both 23 years old, and confirmed that they were members of the group.

Witnesses said the attack occurred in the town of Beit Lahia in the northern Gaza Strip.

An Israeli military statement, apparently referring to the same incident, said that the army returned fire after shots were fired at its soldiers from a Hamas post in the northern Gaza Strip, near the border with Israel.

Palestinian sources said it was a drone attack, while the Israeli statement said it was tank fire.

A video distributed by the Israeli army appeared to show a tank striking a military post in the Gaza Strip.

The military said it was prepared “to target any aggression against Israel and holds Hamas responsible for everything happening in and from the Gaza Strip”.