In The Djinn Waits a Hundred Years (Viking, Jan. 9), a teenage girl named Sana moves with her widowed father into a once glorious, now ramshackle mansion on the seacoast in Durban, South Africa. The house is filled with tenants down on their luck, and with ghosts—whom Sana recognizes, being haunted herself by a spiteful spirit. Trying to make sense of her surroundings, Sana discovers the house’s great tragic, joyful secret: a long-ago love affair that forms one of the book’s two timelines.

In the hands of Shubnum Khan, it all adds up to an enthralling tale. The author is a native and resident of South Africa whose writing has appeared in the New York Times, the Sunday Times, O magazine, and other publications. She talked about her new book via Zoom; our conversation has been edited for length and clarity.

You’ve published a novel and an essay collection in South Africa. Is this the first book that will be published in the United States?

Yes, it’s the first time I’m being published in the U.S. and the U.K.—the first time I’m being published internationally. I’m really excited about it. It’s something I’ve always wanted to have happen, but it took a while. We don’t have an agent culture here, so I had to get an agent. That’s really the only way you can get your books out internationally if you’re an author in South Africa (or any author from Africa). I had to work to get here, but I always knew I wanted my books to reach a larger audience.

Your novel is very immersive—it creates its own world, full of ghosts and stories and what’s called magic realism. I’m curious—what was the starting point for the book?

It really did start from a small idea and blew up. I knew for my next novel the idea was to have a conversation between a younger person and an older person. The idea was that a young girl would move into this apartment, and there would be an older character living upstairs, and they would start these conversations. The older character would tell her about this great love she’d lost—or something about life. Then it really grew. First the apartment became a house, and the house ended up on a cliff, and the house grew and grew, and if you have so many rooms, you have to fill them with characters, and then the house became haunted, and it just grew over the years into this uncontrollable thing.

How long did it take you to write the book?

Eight or nine years. I don’t mean that it was so research-heavy or took up so much of my time. A lot of that time, ideas were stewing, or I was thinking about the writing. It was eight or nine years that the house was growing.

People often say that setting becomes a character in some books, but in this book the house really is a character—it reacts to what people do, it gets cranky, it keeps secrets. Is it based on a real place?

It’s not based on a place I’ve seen, but I am fascinated by haunted houses, and I’m fascinated by the history of things, by the feelings of things. I’m fascinated by what happens to the button that rolls under the couch. I think about inanimate objects as living things, and in this book that’s just transferred over to the whole house. The house came alive in its own way without much work from me.

And where did the djinn who lives in the house come from?

I’ve always been interested in magical things. I do believe in djinns, so I was a little afraid to write about the djinn. But I was intrigued by this idea of a magical being that you can’t see, that can watch you. In Islamic lore, we believe that djinns can fall in love with human beings, and that there are good djinns and bad djinns. I was interested in exploring that idea of a djinn being in love but unable to be seen, not having a voice. Also, I wanted to take control of the narrative about the djinn. Western audiences only know it as the blue genie who grants wishes, and I know it personally as something from the Quran. In some of the stories we tell, the djinn is created out of fire.

The book has two timelines; also, it’s a mystery as well as a ghost story and a romance. Why did you decide to use that dual timeline to tell the story, and how did you maintain suspense?

I always worry that I [won’t be able to pull off a dual timeline], so it feels good to hear someone say I did! I’m not a writer who very meticulously plans things. I wish in my heart I was. I really want to be that writer someday. But I just love creating characters, and then I let them lead me where they want to lead me. The house gave me the space for these things to appear. I knew I was telling a story about the house. This girl moves into this place, and she finds out about something that happened there a long time ago. It came to me as I was getting into it that I had to tell the story of what had happened in the past.

That story has to come to life. We can only feel what Sana is feeling as she reads those diaries if I tell that story as it’s happening. It became clear to me very early on that I needed to have two timelines. But I really struggled. That’s one reason it took so long.

When did you know you wanted to be a writer, and which writers have inspired you?

My grandfather would tell us stories when we were young. My grandmother died when she was fairly young, and he was lonely. So the way to not be lonely was to gather all his grandchildren around and tell them stories. He would put all these things together—Aesop’s Fables, Enid Blyton stories, Arabian Nights, stories from the prophets, stories from the Quran. He would raise his hands, change his voice, and I’d sit there enthralled, thinking, There’s a whole new world out there. That’s when I knew I wanted to be a writer, pretty young, because of my grandfather’s stories. I wanted to be part of this magical world somehow. I dedicated the book to him.

As for writers, there’s Arundhati Roy. When I read The God of Small Things, I think I was 22. I just was like, You can do so much with language; you can make people feel so much with language. You can make a sentence be a whole world.

What are you working on next?

I’m working on a nonfiction book about being single for so long. I’ve been single my whole life. I also wanted to explore what it’s like being a modern Muslim woman in the world today—traveling, expectations and pressures to be in a relationship, my own personal concerns.

Colette Bancroft is the book critic at the Tampa Bay Times.