KOBAR, West Bank — Emad Zibar said his Facebook posts were only offering words of support to his people. Israeli authorities said they were instigating violence.

Israeli troops arrested the 23-year-old Palestinian in a night raid on his West Bank home last summer. Among the Facebook posts listed in the indictment was one that read, “It is written in blood: death, death, death to Israel.”

Zibar was jailed for nine months and fined $550 for incitement and supporting a terrorist entity.

Amid a wave of stabbing, shooting and car-ramming attacks that began nearly three years ago, Israel has stepped up its monitoring of social media and has questioned or jailed users such as Zibar who are deemed to have posted incendiary messages.

Security forces and intelligence agencies are also using computer algorithms to predict the likelihood that a given person will carry out a lone-wolf attack and to intervene before it happens. 

Israel says its methods are working, pointing to a sharp drop in attacks carried out largely by young, disaffected Palestinians. But those methods have generated serious questions about an erosion of privacy, freedom of speech and human rights, for both Palestinians in the West Bank and Arab citizens of Israel — people who rights groups say are most likely to be prosecuted on vague “incitement” charges or to end up on the wrong side of an algorithm. 

For many Palestinians, the knowledge that Israeli authorities are tracking their social media activities is seen as just another level of oppression and restriction in an in­trac­table, ­decades-old conflict.

In 2017, Israel arrested about 300 Palestinians in the West Bank and East Jerusalem on charges related to posts on Facebook, according to a report by the Arab Center for Social Media Advancement. Official numbers have not been made public. 

Zibar’s arrest came days after a brutal knife attack in the Israeli settlement of Halamish, near his home in the West Bank village of Kobar. One of Zibar’s neighbors, Omar al-Abed, 17, stole into the Jewish community late on a Friday night and fatally stabbed three members of a family. Hours earlier, Abed, who Israelis said acted alone, had posted on Facebook: “All I have is a sharpened knife and it answers the call of al-Aqsa.”

From shootings in San Bernardino, Calif., to Las Vegas to car-ramming attacks in Nice, France, and Barcelona, the lone-wolf attacker has presented a particular challenge to law enforcement across the globe. 

In Israel and the West Bank, some 65 people, including two Americans, a Briton and members of the security forces, have been killed in lone-wolf attacks since October 2015, according to the Israel Security Agency. Human Rights Watch reports that more than 270 Palestinians have been killed either carrying out such attacks or in subsequent encounters with Israeli troops.

A new law enforcement unit that includes police and general security personnel has worked to define algorithms to detect potential attackers and inciters. 

“You adapt the algorithms, and you have human resources pinpoint people even before they go out and do what they want to do,” said Gilad Erdan, Israel’s minister of public security, who has also pressed Facebook and Twitter to shut down accounts that are used to call for violence. 

The key terms the researchers look for online change with current affairs, Erdan said, although common key references include Gaza and al-Aqsa Mosque, which stands on a flash-point holy site in Jerusalem.

According to Erdan, the number of attacks against Israelis, most of them in Jerusalem and the West Bank, has fallen by almost 80 percent. He also pointed to a study that found some 60 percent of the lone-wolf attackers between 2015 and 2017 had posted messages on social media indicating their intention to target Israel.

Roni Alsheich, Israel’s police commissioner, said that in addition to key words, the algorithms track the number of social media posts by individuals, as well their relatives and friends. 

“Step by step, we form a good picture,” he said. “After so many years of terrorism, there’s a lot of people around them that were terrorists, which maybe had an influence.”

The challenge, Alsheich acknowledged, is being able to tell whether someone is really planning to carry out an attack — and having enough evidence to charge the person before an attack occurs.

“It’s difficult because we are a democratic state, so sometimes it’s not enough,” he said. “It’s about getting more and more information and ranking, to say this guy is very serious and this guy is maybe half and half, and sometimes we can’t do anything in advance because there is not enough intelligence to arrest him.”

In those cases, the intelligence services may instead detain a person for questioning, he said. 

At a recent security conference in Jerusalem, Prime Minister Benjamin Netanyahu praised the “tremendous algorithms” for helping to bring down the number of attacks. He described having to maintain a balance between upholding security and descending into “tyranny.” 

Such a balance is not apparent in the occupied West Bank, said Fady Khoury, an attorney with Adalah, an Israeli Arab legal and human rights organization. While the algorithms may reduce the number of attacks, he argues, they are unfairly skewed toward Palestinians’ online activity, with right-wing, anti-Arab posts receiving little attention. Right-wing nationalist Jewish groups have also complained of being unfairly monitored. 

“If you arrest all men right now, you prevent most rapes, but nobody thinks that’s feasible in a democratic setting,” Khoury said. 

Others question whether the reduction in attacks is even related to the online clampdown.

Shaul Bartal, who has studied the phenomenon of lone-wolf attackers and has written on the subject, said a better explanation of the decline in the number of attacks might be a change of tactics by the militant groups that inspire such attacks.

“According to my research, most of those who carried out attacks belonged to or supported terror organizations,” Bartal said. “So the question is of timing and of whether these actions are still a priority for the militant groups.” 

“If those groups want this to continue, then it will continue,” he said. “But, really, I think people are just tired of all this. They don’t want any more problems.” 

Bilal Namneh, a legal adviser for Addameer, a human rights organization that supports Palestinian prisoners, represented Zibar after his arrest. Namneh said he has been involved in dozens of similar cases, asserting that the arrests are random and the potential punishment unclear. At issue, he said, is freedom of expression. 

Zibar, who was freed two months ago, is no longer on Facebook. He said that his account was suspended and that Israeli authorities have yet to return his cellphone.

“I don’t think arresting people for Facebook posts will really stop anyone who wants to carry out an operation against Israel,” he said. “Anyone who wants to does not need Facebook to incite him.”

Morris reported from Jerusalem. Sufian Taha contributed to this report.