The High Court of Justice has denied a petition that sought to force Attorney General Yehuda Weinstein to charge the authors of a book that discusses circumstances in which Jews are allowed to kill non-Jews under Jewish law.

The petitioners wanted the authors, rabbis Yitzhak Shapira and Yosef Elitzur, charged with incitement to violence and racism for their book “Torat Hamelech” (“The King’s Torah”).

The court did, however, criticize the way the investigation was handled. Three years ago Weinstein, citing a lack of evidence, closed the cases against Shapira and Elitzur, as well as against rabbis Dov Lior and Yitzhak Ginsburg, who wrote letters supporting the book.

“The steps taken [in the investigation] were far from satisfactory and were too little, too late,” Justice Elyakim Rubinstein wrote Wednesday in a majority decision for himself and Justice Miriam Naor.

“The cancer of racism represented by the authors requires better than this, and it could be that this issue will come up again,” he added, saying his “heart leans toward prosecuting.”

The petitioners said they would seek a rehearing.

Justice Salim Joubran, who was in the minority, wrote that the questioning in the investigation was cursory, and in most cases the suspects invoked their right to remain silent.

“Such an insignificant investment of effort and resources could be interpreted as an attempt by the respondents to do the minimum necessary,” he wrote, adding that the flaws in the investigation were enough to grant the petition.

Rubinstein said there would be difficulties in prosecuting the authors, both because the book discussed Jewish law and because “most of the laws [in the book] deal with the rules of war, which by nature relate to the state and not to the individual,” meaning the work did not necessarily encourage individuals to harm non-Jews.

Comparing this case to that of Rabbi Ido Alba, who wrote a religious-law treatise on killing a non-Jew and was convicted of incitement to racism, Rubinstein noted that Alba also helped obtain weapons for violent operations.

“My heart leans toward prosecuting, while my head has many doubts, even though every part of me rejects the opinions and ideologies of the authors,” Rubinstein said at the start of proceedings Wednesday.

“We’re dealing with a book that wears Jewish garb but is truly anti-Jewish because it defames Judaism. It conveys an evil spirit that isn’t hard to read as being directed against Arabs, who are our neighbors.”

But he added: “We must examine whether intervening in the attorney general’s decision is grounded sufficiently in law, and if we find that this is not the case, even if there is moral justification for the petitioners’ claims and inherent sympathy for them, with a heavy heart we will not grant the petition.”

Naor had a similar view.

“A little imp appeared out of nowhere and whispered in my ear, ‘Put the respondents on trial; let them stand before a court and perhaps they will be forced to explain themselves and undergo a cross-examination, even if nothing came of it and they were acquitted,” she wrote.

But according to Naor, she decided: “We are judges we must weigh relevant considerations and relevant considerations alone.”

In his minority opinion, Joubran wrote that “this case is among those rare instances that require a degree of intervention in the attorney general’s decision,” adding that the threshold should be lowered for suspicions of incitement to racism.

“The current threshold, as expressed by the attorney general’s instructions, leads to prosecution for incitement in only a handful of cases,” he wrote, adding that he feared that incitement and incitement to racism could “become dead letters in the Israeli legal code.”

The petition against Weinstein’s decision was filed in 2012 by groups including the Reform Movement’s Religious Action Center, the Kolech religious women’s organization, Rabbis for Human Rights and the Coalition Against Racism in Israel.

“The ruling is saturated with harsh comments about the book’s racist expressions,” attorney Ruth Carmi from the action center said, noting “two of the leading inciters who have a large following of students ready to turn the book’s hate speech into reality.”

According to Carmi, “In these days so full of tension and violence, we hope the law enforcement authorities acknowledge the court’s harsh words to prevent further incidents of racist violence.”

Gadi Gvaryahu, chairman of the Tag Meir group that fights religiously motivated racism, cited his organization’s “shock and sorrow.”

The book encourages revenge attacks by individuals like Baruch Goldstein, who killed 29 Arabs at the Tomb of the Patriarchs in 1994, and the killers of Mohammed Abu Khdeir and the Dawabsheh family in recent years.

“We are studying the ruling and are considering a request for another hearing based on the Honorable Justice Joubran’s minority opinion and the fact that no clear precedent was set in the Alba ruling,” Gvaryahu said. “We respect the High Court but will ask for a rehearing before an expanded panel of nine justices.”