Police said the gunman, of Jewish faith, “spontaneously stated” he shot two Palestinians, who turned out to be Jewish men from Israel.