In Charles Maturin’s 1820 novel, Melmoth the Wanderer, Melmoth is a man who sold his soul to the devil for 150 more years of life and then roams the Earth looking for someone to take over the bargain. With her own Melmoth, Sarah Perry had something different in mind.

She’d first encountered Melmoth (Maturin’s) as part of her Ph.D, which is in creative writing and which—a shock to no one who has read her—focused on the gothic. “I was completely transfixed by it,” she tells me, from a hotel room in England, where—three days earlier—her own Melmoth has just come out. “It’s very disturbing, it’s very, very dark, but it was also gleefully silly and horrific and rather fun and quite sexy in places.” She got the idea that she might want to write some kind of tribute to it, only she knew from the beginning that her Melmoth would be a woman. And then, she says, the idea “rattled around” in her mind for years.

In the interim, she published two other novels, first After Me Comes the Flood (2014), longlisted for the Guardian First Book Award, and then The Essex Serpent, which took top honors at the 2017 British Book Awards. Both are dark and atmospheric, but with Melmoth, she’s gone full-on gothic horror. It was finally time, she says: She had figured out her Melmoth.

“Round about the time when I began it, the world seemed to be going to hell in a handcart,” she says, listing off a small cross-section of the horrors of 2016. “There was a massacre in the nightclub in Orlando, there was the Syrian refugee crisis, ISIS was still rampaging across the Middle East.” Her Melmoth would be a witness, moving from one horror to another, always watching. She’d created a monster, literally, who’d let her “write about all the ways in which we have a responsibility to bear witness to what is going on in the world.”

This tension, between what is supremely nonfictional and what is fantasy, is what drew her to the gothic in the first place. “It allows you to have your cake and eat it,” she explains. “It’s deeply serious, deeply political, often very angry, always grappling with huge ideas about guilt and transgression and desire, but it’s also huge fun. You get to play around with descriptive imagery and atmosphere and fright and all that stuff.” In other words: It’s a framework to do everything Perry wants to do at once. “I want to write books that are very entertaining and fun, but I also want to grapple with some of the really serious issues of the world,” she tells me. And with Melmoth, which is absorbing and escapist but also viscerally horrifying in very concrete ways, she has done both.

Melmoth To say that it’s a book that’s filled with suffering doesn’t sound very fun, but that isn’t right: The book is fun. It’s also full of suffering. Like Maturin’s novel, Perry’s is structured as stories within stories, all different sites of pain: a boy drawing catastrophic attention to his neighbors in Nazi-occupied Prague; a Turkish bureaucrat drafting papers that will lead to countless deaths. “One of the big challenges is to strike a balance between evoking real pity and empathy in the reader, without ever crossing the line into delight,” she says. She wanted to depict a kind of pain that was “almost too hard to read, rather than delicious.”

It is probably not coincidence that she knew firsthand what she was writing about: While working on Melmoth, she had spinal surgery; she was in tremendous pain. Either that or drugged into a dream state, which, she suggests, gives the book a surreal quality. In an essay for the Guardian, she called Melmoth not her opium novel but her opioid one.

“I didn’t really know what real pain was until last year, and it was the sole preoccupation of my life: pain and Melmoth,” says Perry, very brightly. “So the two things really influenced each other, I think.” She has, she points out, always been interested in “bodies and suffering,” but this new experience allowed her to develop “a very intense feeling of pity and terror for what pain does to people, both psychological and physical,” she says. “You understand so much more about the suffering of others.”

Rachel Sugar is a writer living in New York.