Luckenbooth, the third novel from the bracingly good Scottish writer Jenni Fagan, defies any sort of neat description. Let’s just say that it was, for this reader, no less powerful in its effect than the 1994 film Shallow Grave — Danny Boyle’s debut, and a defining movie for Generation X. In that now-vintage piece, Boyle showed us that Edinburgh’s imposing tenement buildings were perfect settings for tales about mayhem and murder.

There’s obviously also a rich literary tradition associated with the less-than-Muriel-Sparky areas of the Scottish capital (Ian Rankin, Irvine Welsh) but Fagan’s new work is a clever fiction scaffolded on to just one such place: the tenement at 10 Luckenbooth Close, close to St Giles’ Cathedral but hidden down “a shady narrow street”.

Terrible and extraordinary things happen here over the course of the 20th century. The author has constructed the novel in three parts, each containing three stories in three flats, rising up floor by floor through 10 Luckenbooth Close to the top, and ninth floor, where we encounter Dot, a young woman squatting in the now-condemned building in 1999. By then, this once fine place “does not stand up like a time-lord that houses the souls of humans. It is curving over . . . The building’s batteries are almost fully drained.”

This demise is set in motion early in the book (and early in the century) and is linked to the fate of the story’s presiding spirit, 21 year-old Jessie MacRae. It’s not a spoiler to say Jessie is the devil’s daughter — it’s almost the first thing we learn about her. Jessie has killed her father before setting out for Edinburgh from their island home, rowing across in a coffin he had built for her.

The opening of the book is a bleak poem in itself. “My father’s corpse stares out across the North Atlantic swells. Grey eyes. Eyelashes adorned with beads of rain. Tiny orbs to reflect our entire world.”

Fagan switches effortlessly between dreamy prose like this and a more dynamic style. Jessie’s horns — previously nubs — have grown since her father’s death. “I’d say they are almost three inches long on either side now. It is harder to hide them . . . If I’d had horns this sharp whilst he was alive, I’d have staked him at least ten times. My blood can’t carry his sins any more.”

Jessie comes to 10 Luckenbooth Close to meet Udnam, Edinburgh bigwig and owner of the building, and a man to whom she has been sold by her late father. Jessie is to carry his baby. Udnam hasn’t reckoned with a half-supernatural being — she gestates her daughter in three days — and when Jessie meets Elise, Udnam’s young fiancée, they fall for each other immediately. That story ends in extreme violence — and a curse.

There is much more violence to come inside the tenement in later decades, including a memorable 1970s gangland encounter between a local crime family and members of a triad. If you are a squeamish reader (I am) the book can be hard to read at times.

Fagan is unflinching in her depictions of derangement and death but Luckenbooth is compelling and often darkly funny. And Jessie, Elise and their daughter are never quiet or far from the action.

Fagan was named one of Granta’s Best of Young British Novelists in 2013 on the strength of her debut, The Panopticon, which focused on life inside a very different structure, a surveillance-driven tower that houses children in care who have been labelled disruptive.

Fagan herself grew up in the care system; she came to writing relatively late and her storytelling has an urgency and — to use an overused but apt word — authenticity.

That is not to say that the work is “gritty” or “down-to-earth”: there is a fantastical bent to this writing, and the authenticity is in the feelings, in the way the characters’ stories are propelled forward and told with respect. The strong sense of person and place includes the wider city, a constant and untamed living presence:

“Dot does not question why summer has commitment issues. An Edinburgh summer is usually a skittery, lying, drunk, untrustworthy foe — her legs are always spread — elsewhere. She is elusive and unreliable, a total fucking pisshead. The next day (for months) she pretends she’s still far too poorly to make an appearance.”

Fagan corrals demons, spies and famous writers (William Burroughs among others), mediums, misfits and outcasts. Ten Luckenbooth Close both contains them and liberates them, as they live and die and maybe even lurk forever, somewhere in the mysterious world beneath Edinburgh’s beautiful streets.

Luckenbooth, by Jenni Fagan, William Heinemann, RRP£16.99, 352 pages

Isabel Berwick is the FT’s work and careers editor

Join our online book group on Facebook at FT Books Café

Listen to our podcast, Culture Call, where FT editors and special guests discuss life and art in the time of coronavirus. Subscribe on Apple, Spotify, or wherever you listen