HAR ADAR, West Bank — For years, Palestinian laborer Nimr Jamal would make the short daily commute from his West Bank village to this nearby settlement, where he was known as a conscientious worker who earned the trust of local residents, some of whom he even befriended and invited to his wedding.
Then on Tuesday, he pulled out a gun at the back entrance to Har Adar, killed three security men and seriously wounded another before he was shot dead himself.
While Israeli and Palestinian officials traded blame for the shooting, the motive appears to be more pedestrian: Jamal was despondent over his broken marriage and apparently on a suicide mission.
Israeli and Palestinian experts say there have been dozens of similar cases throughout a two-year spate of violence in which suicidal Palestinians plagued by emotional and psychological issues carried out deadly attacks that retroactively were cloaked in nationalism.
Out of some 400 Palestinian attacks tracked by Israel since September 2015, about 18 percent of assailants were driven by personal issues, according to Israel's Shin Bet security agency. Roughly two-thirds of the cases were ideologically motivated, and 15 percent were driven by unknown factors, the agency said.
A Shin Bet official said despondent attackers have included the mentally ill, victims of domestic violence, people with economic hardships and women who had "dishonored the family" with sexual indiscretions. The official spoke on condition of anonymity under Shin Bet procedures.
Turning a personal grievance into a nationalist attack carries several advantages. While suicide is frowned upon in Palestinian society, attacks on Israelis, especially West Bank settlers or security forces, enjoy widespread support, and anyone killed in a clash with Israelis is seen as a "martyr." Their families are eligible for help from the "martyrs' fund," which provides stipends to relatives of people killed or imprisoned by Israel. The Israelis have long claimed this provides an incentive for Palestinian violence.
In the case of Jamal, a Shin Bet investigation found that the 37-year-old was a troubled man with a history of domestic violence. His wife had recently fled to Jordan to escape his abuse, leaving him behind with their four children. In a note later posted on Facebook, Jamal called himself a bad husband and asked for his wife's forgiveness.
His attack shocked the community of Har Adar, where he was a welcome visitor in many homes. The upscale settlement boasts of good relations with neighboring Palestinian villages like Beit Surik, Jamal's hometown.
"This is a single attacker, one guy who is a psycho, and we don't want to associate him with all the other Palestinian workers who have been coming here peacefully for 30 years," said Chen Filipovitz, the head of Had Adar's local council. "He had problems and he brought his problems to us."
Unlike previous rounds of fighting that were organized primarily by established militant groups, the current round has been characterized by "lone wolf" assailants. Israel accuses Palestinian leaders of inciting the violence, while Palestinians say it's the result of the frustration of living under occupation.
Israel captured the West Bank 50 years ago and has built scores of settlements there. Critics say Israel has crippled the Palestinian economy with restrictions on trade, movement and development. With Palestinian unemployment high, tens of thousands of Palestinians work in Israel and settlements like Har Adar.
"People have no alternative to working in Israel and settlements. We are under occupation and have no real economy," said Ahmed al-Jamal, the mayor of Beit Surik.
Still, in a book coming out this week, Palestinian lawmaker Khalida Jarrar said she conducted an informal study in Israeli prisons in which she found that of the 93 women jailed with her, 46 were there as a result of "social oppression."
Jarrar details the accounts of 10 who turned to violence because they were forced to marry against their will. Others described a desire to escape sexual harassment, embarrassing divorces and abusive parents.
One 16-year-old girl told Jarrar that her father tormented her mother and made their life miserable. "I couldn't stand it, so I took a knife and went to the checkpoint," she was quoted as saying.
Jarrar, who spent over a year in prison after being convicted of incitement, denies the allegations and says Israel jailed her to silence her. In her book, the long-time advocate of women's and workers' rights also described difficult conditions for Palestinians in Israeli prisons.
Israel has enacted a policy of demolishing the houses of attackers' families, claiming it is a deterrent. The military said Wednesday it was already preparing to tear down Jamal's home, and Prime Minister Benjamin Netanyahu revoked the work permits of his relatives.
Hawkish politicians have advocated even tougher collective measures, such as banning Palestinian entrance into Israel completely, punishing Abbas' Palestinian Authority and launching a massive settlement drive.
But none of that would do much against those already in Israel with permits, or Palestinian residents of east Jerusalem, who have residency rights and freedom of movement in Israel.
Alaa Abu Jamal, a Jerusalem technician for Israel's phone company, without notice or apparent motive rammed his company car into a crowd in October 2015, killing one Israeli and wounding another. A month later, Raed al-Masalma, an employee of a Tel Aviv restaurant, stabbed two people there.
In the West Bank, where psychological issues are considered taboo, many Palestinians were reticent to discuss the phenomenon because they said it undermined their national cause. In Jamal's village of Beit Surik, most denied he was troubled.
The Palestinian Ministry of Prisoners Affairs refused to discuss the issue for the same reason. However, a lawyer who works closely with many inmates agreed to do so anonymously so as not to violate the confidence of clients.
"Many assailants, particularly women, have carried out attacks to escape social problems," the lawyer said. "When you attack an Israeli you are a national hero."
Associated Press writer Mohammed Daraghmeh contributed reporting from Beit Surik, West Bank.
Follow Aron Heller at www.twitter.com/aronhellerap