Police spokeswoman Luba Samri said the attacker was a 37-year-old Palestinian who approached the back gate entrance of the Har Adar settlement, hiding among fellow Palestinian day laborers who were being checked by security forces.
She said he aroused their suspicions and was asked to stop. At that point, he pulled out a weapon and began opening fire from a short distance. The attacker was then shot dead by other forces at the scene.
The Magen David Adom medical service said that in addition to the three men in their 20s and 30s who were killed, a fourth Israeli man, 32, was evacuated to hospital in critical condition.
Har Adar is an upscale community west of Jerusalem, straddling the seam line between the West Bank and Israel proper — and an unusual target in the wave of violence that Israel has been coping with over the past two years.
Since September 2015, Palestinians have killed 48 Israelis, two visiting Americans and a British tourist in stabbings, shooting and car-ramming attacks.
During that same time, Israeli forces have killed over 255 Palestinians; Israel says most of them were attackers, others died in clashes with Israeli forces. Most of the attacks have been stabbings against security forces, primarily in the West Bank.
Israel blames the violence on incitement by Palestinian religious and political leaders compounded on social media sites that glorify violence and encourage attacks. Palestinians say the attacks stem from anger and frustration at decades of Israeli rule in territories they claim for a state.
The frequency and intensity of attacks has lessened of late but such an incident, coming amid the Jewish high holiday, threatened to ignite them anew.