Three Israeli security men were killed when a Palestinian attacker opened fire on the edge of a town on the West Bank.
Gaza's Islamic Hamas rulers praised the attack but stopped short of taking responsibility for the 37-year-old shooter, who appeared to have acted alone.
The father-of-four approached the back gate entrance of the Har Adar settlement early on Tuesday before hiding among Palestinian day labourers who were being checked by security forces, Israeli police spokesman Micky Rosenfeld said.
He aroused suspicions and was asked to stop, at which point, he pulled out a weapon and began opening fire from a short distance, killing three men aged in their 20s and 30s.
In one of the deadliest attacks in a two-year spate of violence, the attacker, who held a valid permit to work in Israel, was then shot dead by other forces at the scene.
A fourth person was critically wounded, medical services said.
Har Adar is an upscale community west of Jerusalem, on 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.
Shay Retter, the head of Har Adar's security committee, said that between 100 and 150 Palestinian laborers typically enter the community each day for work.
Israeli President Reuven Rivlin said: "The cruel terror attack proves once again the daily front that our security forces face in the most important mission protecting and defending the safety of the citizens of Israel."
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.