The Israeli military said it opened fire after militants attacked soldiers, and it was aware of some uninvolved civilians who were harmed in the raid