Itamar Ben-Gvir, a lawyer representing Mr. Ben-Uliel, said, “This indictment is not the end. It is the beginning of opening a Pandora’s box against Shin Bet.”

“According to the law in Israel, a confession has to be given with free will and the good will of consent,” he said, adding that Mr. Ben-Uliel’s confession “was extracted by force, with blows.”

The authorities used extraordinary methods in this case that were previously reserved for Palestinians accused of terrorism, including preventing suspects from meeting with lawyers, in some cases for the maximum period of three weeks allowed under the law.

In an unusual statement last month, Shin Bet rejected what it described as a “campaign of mendacious defamation” against the agency and its staff, and said it was investigating a “Jewish terrorist network” that was planning future attacks. The agency hinted that it was using harsher methods than usual, in line with procedures permitted in cases of so-called ticking bombs. But it denied allegations of abuse including sexual harassment, kicking and spitting, and also denied that one of the minors had attempted to harm himself or commit suicide, as lawyers and supporters had claimed.

The Israeli authorities determined early on that Jewish extremists were behind the attack in Duma, in which Ali Dawabsheh, 18 months old, burned to death. His parents and elder brother, Ahmad, who was 4 at the time, sustained critical burns over much of their bodies; the father died after a week, and the mother after five weeks. Ahmad is still being treated in an Israeli hospital. Hebrew graffiti including “Long live the Messiah king” and a call for “Revenge!” were found at the scene.

Yet for months, the Israeli police and Shin Bet appeared to have made little progress in resolving the case. The defense minister, Moshe Yaalon, had said that the authorities had a good idea of who was behind the attack but lacked the kind of evidence needed to bring the case to court without harming Israel’s intelligence assets.

Many Palestinians had cited the attack and the delay in bringing its perpetrators to justice as one of the grievances in a buildup of popular anger that has erupted over the last three months in a wave of violent attacks by Palestinians on Israelis.