Of all the reasons to make a movie – money, acclaim, the script you’ve been working on since primary school – the director Robert Eggers had quite a different motivation. “My earliest nightmares were about witches,” he says gravely. “Witch nightmares have plagued me my whole life until, finally, I made this film. I haven’t had any more now. Something was exorcised through making this.”

You wouldn’t necessarily expect a 17th century-set horror story about about Puritans and diabolical possession to be so personal but The Witch, Eggers’s first film, was a demon he needed to expel. Dripping with dread, it’s a very troubling affair that has little in common with the jump-scare thrills of the Paranormal Activities, the Conjurings, the Purges and Insidiouses. Witchcraft aside, it instead concerns itself with more domestic terrors. And rather than giving you short, sharp shocks, it’s a 90-minute exercise in anxiety. You will leave the cinema gathering what nerves you have left and locking them away in a box for safekeeping.

The story anchors on William (Ralph Ineson), a particularly devout English Puritan who, having emigrated with his wife and five kids to New England, lives the simplest of lives on a tiny farm on the edge of a forest. Simple, that is, until a witch steals the baby, crops fail, fingers get pointed, and everything comes apart at the seams. The witch haunts the family just as she did Eggers.

The director himself is from New England, specifically a small rural town called Lee, which is littered with ancient relics. “You can’t help but have New England’s past be part of your consciousness,” he says. “You’re around these dilapidated farmhouses and broken stone walls and little family graveyards, and the atmosphere really seems haunted by the past.”

He wanted to try to articulate those childhood memories in his film and also how he felt “when I was in the cornfield with my father, and the way he smelled, and the way that mist hung over the corn. That’s the approach.”

Eggers, it turns out, has a long fascination with the witchy stuff. His education focused on the region’s colonial history, the revolutionary war and the Salem witch trials. He got hooked, making his parents take him to Salem every Halloween to soak up the mythology. “In addition to its history, it was a big Halloween town, and I felt like I could really have fun and be myself there,” he says. “I asked for costumes instead of toys for Christmas presents, and I wore costumes to school until I was beat up for it.”

Far from being dissuaded, Eggers later became a costume designer, working in theatre and on other directors’ films, as well as directing theatre himself. For his first film, however, he endeavoured to bring the old world back to life. He wanted The Witch to be “like a Puritan’s nightmare was being uploaded” into our brains. As a result, he spent the four years it took to get it funded undergoing Kubrickian levels of research in pursuit of authenticity. He met with 17th-century agricultural experts and colonial historians and pored through religious diaries, letters and Puritan prayer manuals from the time, often using bits of dialogue verbatim for the script.

The Witch director and writer Robert Eggers. Photograph: Jeff Vespa/WireImage

Accuracy was key: the clothes in the film were made from authentic, antique hand-woven cloth, 17th-century musical instruments were used for the soundtrack, and period tools were used to construct the farmhouse. The mist is palpable, and the film was almost entirely shot with natural light and flame, further refining the reality.

“I think there is a kind of magic in the authenticity,” Eggers explains. “Especially as I’m appropriating other people’s words without their permission. Everything needed to be done carefully and respectfully – to the Puritans, to the past, to the witch archetype.” Indeed, what he really wanted to do was communicate what witches meant to these people; how they feared them.

It was important to Eggers to “discover what was important about the witch archetype and why she was powerful. In the early modern period, you had this belief that these evil witches really were stealing children,” he says, “cutting them up, flying on sticks, and if you believe in that reality, that is something really primitive, and really terrifying. So my obsession was to recreate the 17th century in order for the witch to be real again for people, and for her to be powerful again.”

Most effectively, he does that by giving the film contemporary currency, exploring some familiar themes. He doesn’t want to tell people what to think, he says when I bring it up, but, “Yeah, of course it’s feminist.”

Ralph Ineson as Puritan patriarch William.

More so than Ineson’s patriarch, The Witch is about his teenage daughter Thomasin (Anya Taylor-Joy), particularly her feminine power and burgeoning sexuality, and the prevailing negative attitudes of the time towards both. As such, Thomasin bears the brunt of the finger-pointing when the diabolic kicks off. The film’s witch is a vessel for the characters’ fears and desires, but Thomasin’s femininity is the hot potato. Was this something Eggers wanted to explore from the start?

“It happened the more I understood what the witch archetype was about, positively and negatively, and especially what she meant in the period,” he says. “The earliest versions of this story had no protagonist; I spread it all out among the family and the witch manifested herself in different ways. But when it became clearly Thomasin’s story, I looked at stories of young women who were accused of being witches or supposedly possessed by the Devil, or even some women who believed that they were evil witches. In the construct of the society they couldn’t do bad things themselves because they were powerless, so it had to be Satan that would give them the power to create this fear in people.”

Above all, though, The Witch is a tremendously creepy, immersive horror piece. Eggers claims not to be a big horror fan, other than an obsession with The Shining, a key inspiration for The Witch in terms of tone and atmospherics.

“For me, good horror is taking a look at what’s actually dark in humanity, instead of shining a quick flashlight on it and running away giggling,” says Eggers. “And also just trying to build tension and mood. I had a lot of guilt and anxiety as a child, and would spend months in terror, with a weight on the back of my head, for almost no reason. And I really wanted to try to capture that feeling in the movie.”

Kate Dickie as Puritan mother Katherine. Photograph: Publicity image

With its olde Englishe lingo, broad hats and bonnets, and the odd demonic goat, The Witch is certainly unlike any of those other horror films doing such big business in the multiplexes. Generally, Eggers says, he just doesn’t “do” contemporary.

“I watch older films, read older books, look at older pictures, listen to older music than other people,” he says. “So I come up with stuff that feels a little bit less incestuous with pop culture. I don’t think you’re gonna see me doing anything modern any time soon. I wouldn’t do a film that takes place today.”

Why is he so compelled by period pieces? “I just think there’s more weight in the past,” he says. “I find it’s a better place to ask big questions. People do that a lot with science fiction today because of where we’re at as a society, which makes perfect sense. But the dead speak more loudly to me than the future.”

Sure enough, The Witch’s 17th-century fancies say more about us as people than many of the fun yet disposable horrors set in the present day. And it’s scarier, too. The film may have put an end to Eggers’s nightmares, but it may just give you some of your own.

The Witch is in cinemas from Friday 11 March