A few episodes into “Our Boys,” Simon, an agent for the Shabak, Israel’s internal security service, talks with two policemen about a case that they are struggling to solve: the death by burning of a sixteen-year-old Palestinian boy. He was abducted in the aftermath of another horrific crime, Hamas’s kidnapping and murder of three Jewish teen-agers—students whose disappearance united Israelis, first in the hope that they would be rescued, and then, once their bodies were discovered, in grief and rage.

Revenge seems to be the likely and logical motive, but the cops reject it. “Jews would never do this,” one of them says, making a dismissive gesture.

“You sure?” Simon asks.

“Yes,” the cop says.

“So is my mother,” Simon says, showing him a text message: “Thank God Jews didn’t do this, take care.”

“Just like my mother,” the second cop replies—and holds up a similar text.

“Let’s recruit them,” Simon says.

It’s the world’s bleakest Jewish-mother joke, a rare moment of humor in “Our Boys,” a galvanic new series on HBO, co-produced with the Israeli network Keshet. Ten episodes long, the show is a partly fictional deconstruction of a hate crime that took place in 2014 and led directly to war in Gaza. It’s a story of family grief and family dysfunction, and also a beautifully paced thriller about a police investigation. But it’s something more ambitious, too: a challenging work of art about the intractable problem of identity—the struggle of any individual to maintain core values, when the world demands nothing but solidarity based on shared victimhood. The show is unusually fearless about letting moral discomfort linger, and manages to be stirring without ever offering false hope, a rarity for even the best-made dramas.

“Our Boys” (which was created by three Israelis, two Jewish and one Arab: Hagai Levi, who made “In Treatment”; Joseph Cedar, of “Footnote”; and the director Tawfik Abu Wael) was bound to attract controversy. During the run-up to this month’s elections in Israel, Prime Minister Benjamin Netanyahu attacked it as anti-Semitic propaganda and urged Israelis to boycott it. He also, in his Trumpian style, took aim at Keshet—which has, not coincidentally, helped publicize corruption allegations against him.

Netanyahu’s description is nonsense. “Our Boys” is thoughtful and layered in its portrayal of both Jews and Palestinians. Like many diaspora Jews, I know only a little about Israeli culture, but even I recognize that the show has a deep sense of specificity, from the cramped Jerusalem kitchens to the gated back yards in the settlements and the streets lit by Ramadan lights as Muslim families walk beneath. The series explores tensions between big-city secular Ashkenazi Jews and ultra-Orthodox Sephardic settlers, laying out divisions within the families of the victims and the perpetrators. It also dramatizes both the broken and the functional aspects of the Israeli justice system—which, through skilled police work, nailed the killers of the Palestinian boy, Mohammed Abu Khdeir, in only a few days.

What the show doesn’t do is focus on the first crime, the murders of Naftali Frenkel, Gilad Shaer, and Eyal Yifrah. Instead, it views that crisis from a mediated distance, often showing protests and rallies through screens—on phones and on TV—scanning crowds gathered at the Western Wall, praying for the boys’ return, as their mothers plead for their sons’ lives. This narrative choice has divided viewers, but it feels purposeful: despite the title, this is a story about one boy, Mohammed, and it is being told precisely because his death struck so many Israelis as beyond belief. At the funeral of the Jewish teen-agers, Netanyahu said, “A deep and wide moral abyss separates us from our enemies. They sanctify death, while we sanctify life. They sanctify cruelty, while we sanctify compassion.” Yet, in the first episode, we watch a young ultra-Orthodox man drift through a crowd of protesters, clutching his guitar, absorbing the furious chants of “Death to the Arabs!”

The series’ central emphasis is on how easily such dehumanizing rhetoric can sway vulnerable minds, a theme that should feel uncomfortably relevant to American viewers. Still, the show’s greatest strength may be the way that it contains its own critiques, letting contradictory impulses smack against one another without resolution. Even the most villainous character gets to make his case, discounting what he perceives as the weakling, watery mind-set of Ashkenazic liturgy: “On the one hand, on the second hand, the third hand, the fourth hand—sometimes you need to pick up a sword and slaughter.” By the finale, every concern that a critical viewer might raise has been addressed. Characters argue that Mohammed’s death is a “man bites dog” exception; they debate the line between mental illness and fanaticism, the immense power gulf between Israeli citizens and Palestinians suffering under the occupation, the fraught notion of collective punishment. At its heart, this is a show about the brutal economics of empathy in a time of war: who gets it, who deserves it, who is denied it.

Jony Arbid and Ruba Blal Asfour are immensely poignant as Mohammed’s parents, whose sorrow and panic pervade the first few episodes, in which Mohammed disappears and then, once his body is found, is proclaimed the Dawn Martyr by fellow-Palestinians, who pressure his parents not to lend support to the Israeli trial. Shlomi Elkabetz is coolly fascinating as the soft-spoken Simon, a Moroccan-born agent in the Shabak’s Jewish Unit, which investigates crimes perpetrated by Jews, and who comes from the same Sephardic ultra-Orthodox background as the murder suspects. In later episodes, Noa Koler is a standout as the prickly, complex Dvora, a psychiatrist to the ultra-Orthodox community, who is faced with a set of ethical quandaries: What is her obligation to a mentally fragile patient under investigation? To her country? To the community she serves?

Simon and Dvora are both riveting figures, different kinds of detectives who use emotional intuition to arrive at different notions of justice. They are also composite characters, based on the writers’ interviews with multiple agents and psychiatrists. That’s a complicated ethical choice of its own. But it ends up being effective, freeing the series to feel authentic without being literally true, enabling it to enter into intimate, manipulative relationships—between agents and suspects, shrinks and patients, and, crucially, among participants in the locked universe of ultra-Orthodox settlers.

The show covers a huge amount of ground, tracing the crime, the police and political response, and, finally, the trial. Ironically, given Netanyahu’s attacks on the media, “Our Boys” is especially damning toward television news, which let rumors—that Mohammed was gay, among others—air unchecked. “This murder will be remembered as an honor killing forever. ‘Arabs killed a fag, that’s how it is,’ ” the man who planted the story says, smirking. “That’s how you form public opinion.”

In the fifth episode, Simon goes undercover among the prime suspects, the narcissistic owner of a Jerusalem eyeglass shop and his nephews, all of them related to a prominent ultra-Orthodox rabbi. The cops bug their houses, tap phones, and monitor alleyways from the sky. Simon—using his family knowledge of Mizrahi manners—embeds with them, disguised as a reserve-duty soldier. He gets invited to Shabbat dinner; he bonds with a local rabbi. He’s particularly drawn to Avishai, the sixteen-year-old boy we glimpsed in earlier episodes, weeping about the lost teen-agers, floating through the protests with his guitar.