The legal protection of minors through judicial process takes an unanticipated turn in “The Children Act,” another thought-provoking drama adapted by Ian McEwan from one of his own novels. Whether it will be any more successful in attracting an audience than “On Chesil Beach” was, however, is doubtful, despite its intelligent script and outstanding performances.

Emma Thompson, in an exceptionally sharp turn, plays Fiona Maye, a British High Court Justice who is often called on to oversee cases stemming from the 1989 Children Act, which specifies that a judge will decide on complicated matters that threaten the well-being of any individual less than seventeen years of age, overriding even the family’s preferences. We see her, for example, rendering a decision on whether conjoined infants should be surgically separated, even though one of them will inevitably die in the process.

The focus of the film, however, is on the matter of Adam Henry (Fionn Whitehead), a seventeen-year old boy whose leukemia, the doctors say, will kill him in the absence of a blood transfusion. The obstacle is that he and his parents are Jehovah’s Witnesses, and their faith forbids transfusion since a person’s blood is the carrier of his unique soul. Fiona considers the objections of his parents (Ben Chaplin and Eileen Walsh) to the procedure, as well as the urgent request of the boy’s doctor to permit it, and then takes the unusual step of visiting the patient in the hospital.

She finds Adam a thoughtful boy, as committed as his parents to his religious beliefs, but also an ingratiating person, interested in music and poetry. They even join together in singing a folk song to his guitar playing—“Down by the Salley Gardens,” which as it happens she, as pianist, is rehearsing with her lawyer friend Mark (Anthony Calf) for performance at an elegant charity affair.

Fiona’s decision will save Adam, but it has unexpected ramifications: the boy becomes fixated with her, a sort of benign stalker despite her insistence that he understand the case is over and he must get on with his life. The tense connection between them is stressful on her, especially because she is simultaneously facing the collapse of her marriage to Jack (Stanley Tucci), an academic who has concluded that his wife’s devotion to her job has left no room in the marriage for the intimacy they once enjoyed. He announces his intention to embark on an affair—a “sensible” solution, in his mind, which Fiona finds deeply troubling.

The marital subplot is, frankly, not terribly convincing, although one can certainly see that McEwan intends to connect the couple’s lack of children with the way in which Fiona is emotionally drawn to a boy whom she might consider, in an oblique fashion, a sort of surrogate son. But the central relationship between the judge and the boy her decision has saved, though presented in the subtly enigmatic, allusive fashion that is McEwan’s stock in trade, is strong enough to make “The Children Act” an engrossing piece of work, down to its wrenching conclusion.

It is certainly elegantly made, propelled by a wonderfully shaded performance from Thompson—easily her best work in years—and a compelling one by Whitehead, who conveys the desperation of a young man searching for answers in a world that is essentially new to him with remarkable depth. And while Tucci is unable to raise Jack above the level of a convenient literary conceit, and the supporting turns by even so fine an actor as Chaplin are mostly unremarkable, Jason Watkins offers a wittily observed portrait of her clerk Nigel, harried but serious-minded and always impeccably organized.

Richard Eyre directs with a steady, unfussy hand, and the physical production exhibits fine craftsmanship from production designer Peter Francis, cinematographer Andrew Dunn and editor Dan Farrell. Stephen Warbeck composed the original score, but much of the music consists of snatches of classical pieces, most prominently by Bach, which sometimes italicizes the tale’s dramatic beats. As in “Beach,” however, McEwan is interested in making his points through music as well as plot, dialogue and visuals.

One can imagine “The Children Act” as a standard issue-oriented telefilm delivering its message bluntly and gracelessly. That it emerges in this telling as a subtle, multifaceted and genuinely moving drama is perhaps not surprising, given the talent involved, but it is a considerable accomplishment.