The shooting took place against the backdrop of nearly two years of war in Gaza, where Israel's campaign against militant group Hamas has left the territory in devastation.