A Palestinian attacker opened fire early on Tuesday at the entrance to a settlement outside Jerusalem, killing three Israeli men and critically wounding a fourth, Israeli police and medical services said.

It was one of the deadliest attacks in a two-year spate of violence.

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 labourers 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 taken to hospital in a critical condition.

Har Adar is a 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 more than 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.

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".

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.