Israel's High Court of Justice ruled unanimously today that the country's security police have acted illegally by routinely inflicting physical pain -- torture, in the view of human rights groups -- on Palestinian detainees.

The 9-0 ruling by Israel's highest court overturns decades of officially sanctioned practice. It strikes at the heart of a widely accepted credo in Israel's security community and society: Subjecting Arab prisoners to excruciating physical abuse -- including beatings, violent shaking and sleep deprivation -- is acceptable in the name of safeguarding the security of the Jewish state.

The court found that despite "the harsh reality of terrorism" against Israel, the methods that the General Security Service has used to interrogate Palestinian detainees, at least since the early 1970s, have no basis in law.

"This is the destiny of a democracy, as not all means are acceptable to it, and not all practices employed by its enemies are open before it," Court President Aharon Barak wrote in a lengthy decision. "Although a democracy must often fight with one hand tied behind its back, it nonetheless has the upper hand."

Despite the court's evident distaste for the interrogation practices, it left open the possibility of a legislative end run around its ruling. It said Israel's parliament may enact a law permitting what the court delicately called "physical means in interrogation." But the court, in turn, could strike down such a law.

"We do not take any stand on this matter at this time," the court's Barak wrote.

The decision struck here with a moral force akin to the U.S. Supreme Court's ban on school segregation nearly a half-century ago, and raised basic questions about the nature of Israeli society. The ruling, which noted that international law prohibits torture in all cases, was the subject of immediate and impassioned public debate in a country that was reminded of the threat of terrorism a day earlier, when nearly simultaneous car bombs exploded in two northern cities.

Public debate, aired on radio talk shows and on television, was divided along two major lines: those who believe Israel is properly part of the democratic West and should behave accordingly, and those who contend that in the hostile reality of the Middle East, it cannot afford liberal niceties such as excluding some forms of torture.

"I cannot exaggerate the importance of this decision for victims and for the very nature of Israel as a democratic country that abides by international law," said Eitan Felner, executive director of B'Tselem, an Israeli human rights group. "Israel during all these years has undermined the universal consensus on the prohibition against torture."

Other Israelis denounced the decision, insisting the court had hamstrung the Shin Bet security service in its fight against terrorism. Scores of Israelis died in Arab terrorist attacks, including suicide bombings, in the mid-1990s, although the incidents have diminished somewhat since then.

"It's very nice to have a very liberal legislation," said deputy defense minister Ephraim Sneh, a retired general. "It's good in Scandinavia, in Western Europe, maybe North America. But in this part of the world, where we fight so bitterly with terrorism, it's such a burden that it's almost irrelevant to the reality that we live in."

The court, which had pointedly ignored the issue of interrogations for years, appeared to anticipate the storm of criticism its ruling generated. Nearly three-quarters of Israelis tell pollsters that they approve of the use of torture in some cases. Human rights groups that have demonstrated various interrogation techniques as street theater in Jerusalem have been met by passersby calling out: "They deserve it!"

"We are aware of the harsh reality of terrorism in which we are, at times, immersed," Barak wrote. "Our apprehension is that this decision will hamper the ability to properly deal with terrorists and terrorism, which disturbs us. We are, however, judges. Our brethren require us to act according to the law."

Prime Minister Ehud Barak -- no relation to the High Court president -- reacted cautiously to the decision, saying the ruling could cause difficulties for the security service in its fight against terrorism.

According to human rights groups, since 1970 about 20 Arabs have died and thousands have been hospitalized because of Shin Bet's methods. B'Tselem estimates that Shin Bet tortures about 85 percent of the 1,000 Palestinians it interrogates annually. Shin Bet denies it.

Human rights groups have documented cases of abuse of hundreds of detainees, some of whom were never charged with a crime.

Nonetheless, in 1987 a government commission headed by Moshe Landau, a former Supreme Court president, gave Shin Bet sweeping powers to use "moderate physical force" to extract information. Since then, Shin Bet has justified the use of these practices by invoking the "ticking time bomb argument" -- that because of the danger of imminent terrorist attack, Israel is justified in using torture to squeeze information from suspects.

Ruling today in a case brought four years ago by the Public Committee Against Torture in Israel, the court acknowledged that in exceptional circumstances, very rough treatment of detainees may be legally defensible. But that is different from granting Shin Bet agents blanket authority to inflict pain during interrogation, the court said. In fact, the court ruled, inflicting pain on detainees has no grounding in Israeli law.

"A reasonable investigation is necessarily one free of torture, free of cruel, inhuman treatment of the subject and free of any degrading handling whatsoever," it said.

That standard seemed at odds with the court's description of one technique used in Shin Bet interrogations:

"A suspect . . . has his hands tied behind his back. He is seated on a small and low chair, whose seat is tilted forward toward the ground. One hand is tied behind the suspect, and placed inside the gap between the chair's seat and back support. His second hand is tied behind the chair, against its back support. The suspect's head is covered by an opaque sack, falling down to his shoulders. Powerfully loud music is played in the room. . . . "

Former Palestinian detainees report lasting disabilities as a result of interrogation. In testimony to human rights groups, they supplied details that the court did not mention -- for instance, that the hoods placed over the heads of Arab detainees often stank of vomit or urine. Interrogations can last for days, weeks or months.

"Hundreds, thousands of Palestinians suffered like me," said Nawwaf Qeisi, 24, a political activist who said his three-month interrogation by Shin Bet in 1997 left him with an injured back. "How can I hate all Israelis because of that?"

Nonetheless, Qeisi did not disguise his feelings for his interrogators. "They must be punished," he said. "I always told my Shin Bet interrogator, `I'm going to go to court and tell the judge what methods you are using against me.' "

"And he would say, `Who are you going to complain to when the judge himself is your enemy?' "