A fiercely committed ensemble and an exquisite sense of historical detail conspire to cast a highly atmospheric spell in “The Witch,” a strikingly achieved tale of a mid-17th-century New England family’s steady descent into religious hysteria and madness. Laying an imaginative foundation for the 1692 Salem witchcraft trials that would follow decades later, writer-director Robert Eggers’ impressive debut feature walks a tricky line between disquieting ambiguity and full-bore supernatural horror, but leaves no doubt about the dangerously oppressive hold that Christianity exerted on some dark corners of the Puritan psyche. With its formal, stylized diction and austere approach to genre, this accomplished feat of low-budget period filmmaking will have to work considerable marketing magic to translate appreciative reviews into specialty box-office success, but clearly marks Eggers as a storyteller of unusual rigor and ambition.

A New England-born, Brooklyn-based talent who started out in the theater, Eggers has several film credits as a production/costume designer and art director, as evidenced here by his subtle yet meticulous visuals and bone-deep sense of place. The verisimilitude is striking: Produced in the abandoned lumber town of Kiosk in a heavily wooded region of Northern Ontario, and lensed by d.p. Jarin Blaschke in beautifully muted, mist-wreathed shades of gray, “The Witch” (which bears the subtitle “A New-England Folktale”) confines most of its fleet 92-minute running time to a small farm at the edge of a dark forest circa 1630 — a setting whose atmosphere of mystery and menace is no less unsettling for being possibly imagined.

This isolated backdrop is no place to build a home or raise a family, yet that is what farmer William (Ralph Ineson) is forced to do after being banished from his plantation for some vague but religiously motivated clash of wills. Now he lives in exile with his severe wife, Katherine (Kate Dickie), and their five children, each of whom will have his or her part to play in the tense, sparely plotted drama that unfolds — starting with the youngest, the infant Samuel, who suddenly vanishes from the farm while being watched by his sister, Thomasin (Anya Taylor-Joy). Almost immediately we glimpse a disturbing image of the boy’s fate in the form of some unspeakable blood rite, though it’s unclear whether something satanic is actually taking place, or whether these are merely the nightmarish visions of William and Katherine, who fear that their unbaptized son is not just lost but damned.

As the firstborn child and the one ostensibly to blame for Samuel’s disappearance, the suggestively named Thomasin quickly becomes the family scapegoat, as well as a convenient symbol of female iniquity. When the inconsolable Katherine isn’t burying herself in weepy, wailing prayers for Samuel’s soul, she’s bitterly lashing out at Thomasin for her perceived negligence, despite the girl’s protests that she has done no wrong. William, though no less intense in his Christian devotion, is somewhat more forgiving, not least because he’s acutely aware of his own failings as a husband and father; it’s because of his stubborn pride that he and his family are now forced to fend for themselves, with a failing crop and no community support to help get them through the difficult months ahead.

Striving to help out as best he can is the second eldest child, Caleb (Harvey Scrimshaw), a God-fearing lad who’s not too afraid to venture into the nearby woods in search of food and animal pelts. But if there’s a thematic constant here, it’s that even the most good-hearted children are susceptible to impure thoughts and worldly temptations. Certainly that’s true of the younger twin siblings, Mercy (Ellie Grainger) and Jonas (Lucas Dawson), two pint-sized mischief makers who become convinced that Thomasin is the Devil’s handmaiden, even as they seem to have formed a rather unhealthy attachment to the family goat, the ominously named Black Philip.

The goat, of course, is a widely recognized symbol of Satan, and the presence of Black Philip is but one of many winking horror tropes that Eggers skillfully puts into play here: Between the bad-seed moppets and the ruined harvest, the mysterious disappearances and the frightening instances of animal misbehavior, “The Witch” is rife with intimations of inexplicable evil, of something deeply twisted and unnatural at work. At the same time, the film grippingly ratchets up the family tension on multiple fronts, to the point that it could almost be read as a straightforward portrait of emotional and psychological breakdown — exacerbated by the parents’ certainty that every setback is a test from the Lord. “Place thy faith in God,” William instructs his children more than once, though the implication is clear that unchecked piety, far from warding off demons and monsters, can merely wind up creating new ones in their place.

The result plays like a sort of cross between “The Crucible” and “The Shining” (which Eggers has cited as a key inspiration), with a smattering of “The Exorcist” for good measure. But in peering ahead to the Salem trials, “The Witch” also faintly echoes Michael Haneke’s “The White Ribbon,” another drama in which the forces of patriarchal repression and the cruel realities of agrarian life will exact a devastating future toll: We’re watching not just a private tragedy but a prequel to a larger-scale catastrophe, sowing seeds of suspicion, violence and fanatical thinking that will be passed down for generations to come.

At the same time, Eggers isn’t content with a strictly rational interpretation. He seems fascinated by the lore and iconography of the period (written accounts from which directly shaped the film’s archer-than-thou dialogue); by the terror and superstition that flourished in the wake of widespread starvation, illness and infant mortality; and above all by a grand tradition of supernatural horror filmmaking that has long preyed on those specific fears. If “The Witch” is ultimately a cautionary tale of Christian belief run amok, it also seeks to give the Devil his due — to illuminate a collective paranoid nightmare by blurring the line where grim reality ends and dark fantasy begins.

A certain teasing ambiguity remains, not always to satisfying ends. There are moments when the story simply seems to be having it both ways by willfully obscuring the truth of what’s going on, and post-screening debates will center heavily around the meaning and necessity of the coda, which puts a hair-raising spin on a classic thriller convention. But at its core, this is a searing, credible portrait of fraught emotional dynamics at war with unyielding spiritual convictions, fearlessly played by a cast that shares Eggers’ dedication at every step.

Not least among the director’s smart decisions was the casting of two excellent, under-the-radar British actors as the parents, whom we learn emigrated from England not too long before the events in question. Ineson brings tremendous gravitas to the role of the well-meaning but self-deluding William, and Dickie, still best known outside the U.K. for 2007’s “Red Road,” is all but unrecognizable here, allowing the odd moment of vulnerability to flicker across her pale, careworn face when it’s not twisted into a scowling mask of resentment.

The two child leads more than hold their own; whether he’s walking quietly through a clearing or, at one point, violently speaking in tongues, Scrimshaw commands the screen with magnetic ease. But if there’s any one performer to whom the movie belongs, it’s Taylor-Joy as the grievously misunderstood young woman who may or may not be the witch of the title. Capable of looking at once beamingly innocent and slyly knowing, her Thomasin increasingly becomes the movie’s voice of conscience and reason, precisely because she threatens to complicate and subvert her parents’ rigid moral universe.

The hushed intensity of the drama is bolstered at every turn by the precision of the filmmaking, which bespeaks exhaustive research and painstaking execution in all departments, from production designer Craig Laithrop’s sets (detail-perfect down to the oak clapboards and reed-thatched roofs) to the hand-stitched costumes designed by Linda Muir. Blaschke favors carefully framed, naturally lit compositions, while Louise Ford’s sharp editing, though not without its elliptical moments, never lingers at the expense of narrative drive. Crucial to establishing the film’s mood is Mark Korven’s something-wicked-this-way-thrums score, which blends eerie choral performances and dissonant strings into an unnervingly cacophonous whole.