The Israeli military says troops have shot and killed two armed Palestinian gunmen outside a Jewish settlement in the West Bank .