A Palestinian attacker opened fire early Tuesday at the entrance to a settlement outside Jerusalem, killing three Israeli security men and critically wounding a fourth, Israeli police and medical services said, in one of the deadliest attacks in a two-year spate of violence.

Gaza's Islamic Hamas rulers praised the attack but stopped short of taking responsibility for it. Israeli officials said the attacker was a 37-year-old Palestinian father of four who appeared to have acted alone.

The attack comes at a tense period amid the Jewish high holidays and is likely to complicate the mediation efforts of US peace envoy Jason Greenblatt, who had just arrived in the region for meetings with Israeli and Palestinian leaders.

One million Palestinian children in 'unlivable' conditions amid power shortages

Speaking at his weekly Cabinet meeting, Israeli Prime Minister Benjamin Netanyahu said the attack was partially a result of systematic Palestinian incitement and said he expected Palestinian President Mahmoud Abbas to "condemn this attack and not try to justify it."

Police spokesperson Luba Samri said the attacker approached the back gate entrance of the Har Adar settlement, hiding among dozens of Palestinian day labourers who were being checked by security forces.

The man aroused police suspicions and was asked to stop, Ms Samri said. At that point, he pulled out a weapon and began opening fire from a short distance. The attacker, who held a valid permit to work in Israel, was then shot dead by other forces at the scene.

The Magen David Adom medical service said that in addition to the three killed, a fourth Israeli man, 32, was evacuated to hospital in critical condition. The casualties were identified as Solomon Gavria, a 20-year-old policeman, and two private security guards.

Israel: From independence to intifada Show all 7 1 /7 Israel: From independence to intifada Israel: From independence to intifada The proclamation of the state of Israel is read by David Ben-Gurion in Tel Aviv on 14 May 1948 © EPA Israel: From independence to intifada Sixty years on, an illuminated flag is shown in Tel Aviv this week © PA Israel: From independence to intifada Young Jews celebrate the proclamation of the state of Israel in 1948 © AFP/Getty Images Israel: From independence to intifada Palestinian children throw stones at a retreating Israeli tank during an incursion into the West Bank city of Jenin in August 2003 following a suicide bombing in Jerusalem © AP Israel: From independence to intifada How Israel's borders have changed - click image to enlarge © Independent Graphics Israel: From independence to intifada From 1948-50, the world's mostcelebrated war photographer Robert Capa captured extraordinary imagesof Israel's pioneering settlers. Here, Turkish immigrants arrive in Haifa © Robert Capa/Getty Images Robert Capa/Magnum Israel: From independence to intifada The Negba kibbutz, where the walls have been damaged by shells fired during the Israeli-Arab war © Robert Capa/Getty Images Robert Capa/Magnum

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.

Shay Retter, the head of Har Adar's security committee, said that between 100 and 150 Palestinian labourers typically enter the community each day for work. Local residents said they knew the attacker from previous work he had carried out in the community and were shocked to hear what he had done. The military imposed a closure on the nearby Palestinian village of Beit Surik, the home of the attacker.

Israeli Defense Minister Avigdor Lieberman said he saw no difference between Palestinian terrorism and radical Islamic terrorism targeting sites in Europe and elsewhere.

"Before talking about any kind of negotiations, the world must demand of the Palestinian Authority to stop its incitement and encouragement of terror," he said, alluding to Mr Greenblatt's visit and his goal of securing concessions for Palestinians.

Minister of Intelligence Israel Katz was even blunter.

"The attack is also a message to special US envoy Greenblatt," he said. "Israel's security was and yet remains the supreme consideration in the government's policy, and is above any other consideration of improving and easing the lives of the Palestinians."

Mr Netanyahu pledged that as a punitive measure, the attacker's home would be demolished and working permits of his extended family would be revoked.

However, Israel's internal Shin Bet security service downplayed ideology as a motive, saying the attacker was plagued with personal issues.

The attacker was identified as Nimr Mahmoud Ahmed Jamal and the Shin Bet said its preliminary investigation indicated there was significant violence in his family. His wife had recently fled to Jordan and left him with their four children, it said.

Since September 2015, Palestinians have killed 51 Israelis, two visiting Americans and a British tourist in stabbings, shooting and car-ramming attacks. Several of these attacks were carried out by individuals struggling with domestic and emotional issues whose acts were subsequently cloaked in nationalism.

During that same time, Israeli forces have killed over 255 Palestinians. Israel says most of them were attackers and others died in clashes with Israeli forces. Most of the attacks have been stabbings against security forces, primarily in the West Bank.

Trump: Israelis and Palestinians are 'reaching for peace'

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.

Gaza's Hamas called Tuesday's assault a "heroic operation" that was a "natural response" to Israeli aggression against Palestinians and proved that the Palestinian uprising was still alive.

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