Har Adar - AFP
Directly at the two private security guards, who were shot and killed directly at the scene," Rosenfeld said.
He also fired at a nearby border policeman, who was left dead, before two other officers shot and killed the gunman.
- Work permits under review -
Israel's Shin Bet internal security service identified the gunman as Nimer Aljamal, a 37-year-old father of four from the nearby Palestinian village of Beit Surik with no previous "security background".
"The preliminary investigation indicates that he had significant personal and family problems, including those regarding family violence," it said.
"His wife fled to Jordan several weeks ago and left him with their children."
Rosenfeld described Aljamal's profile as "very unusual" by comparison with others who have carried out a wave of lone-wolf attacks in Israel and the Palestinian territories during the past two years.
He said there would have to be a security review of work permits for Palestinians to work in Israel and the settlements, with tens of thousands granted.
Israeli authorities later raided Beit Surik and Aljamal's home and arrested his older brother.
"We were surprised this morning with the news because we did not have prior knowledge," said Aljamal's uncle, Issa Jamal.
Aljamal's aunt Rihab Jamal said: "We were shocked. May he rest in peace. He wanted to be a martyr and he got it."
Netanyahu called on the Palestinian president to condemn the attack.
"I expect (Abbas) to condemn the attack and not try to justify it," he said.
Palestinian Islamist movement Hamas, which rules Gaza, hailed the attack as "revenge for the crime of occupation against our people."
The UN envoy to the Middle East Nickolay Mladenov condemned both the attack and the Hamas reaction.
"It is deplorable that Hamas and others continue to glorify such attacks, which undermine the possibility of a peaceful future for both Palestinians and Israelis," he said.
US ambassador to Israel David Friedman, who has been a supporter of Israeli settlements, said on Twitter "once again, Israelis confront the cruel and evil brutality of unprovoked terrorism."
The European Union said "there can be no justification for such a crime and attempts by Hamas to glorify the attack are reprehensible".
- 'This place is quiet' -
Police named the border policeman killed as Solomon Gavria, 20.
The other two victims were identified as Youssef Ottman, 25, and Or Arish, 25.
The three were buried in separate ceremonies on Tuesday afternoon.
Har Adar resident Steve Leibowitz, 65, said the settlement's proximity to the Green Line had always made it feel safe.
"This place is quiet. We're inside the West Bank but we have a border fence and we feel as though we are inside Israel and safe," he told AFP.
"Until today I haven't locked my doors in years. Now I will be locking the doors."
The latest attack comes nearly two years after a wave of unrest broke out.
The violence had greatly subsided in recent months but Shin Bet chief Nadav Argaman warned this month that the risk of new attacks was ever present.
West Bank settlements are a source of significant tensions between Israel and the Palestinians and have been a major sticking point in peace talks.
The UN envoy told the Security Council on Monday that Israel continues to build settlements "at a high rate," in defiance of Security Council demands for an end to their expansion.
The international community regards all Jewish settlements in the occupied West Bank, including Israeli-annexed east Jerusalem, as illegal.
They are seen as major stumbling blocks to peace as they are built on land the Palestinians see as part of their future state.
Source: AFP