At the time of the assault , police said a gunman seized a rifle from an Israeli security officer at the work zone and then shot and killed two Palestinians he had driven to the job site .