In a dark prison cell somewhere in the Negev, a cell that doesn’t exist in any written record, Prisoner Z spends endless days alone, with his guard. In “Dinner at the Center of the Earth” (Knopf), Nathan Englander artfully spins a complex twist of stories of how this yeshiva-educated boy from Long Island ends up as an Israeli spy, living many lives undercover in Paris and Berlin, and then condemned to this cell.

The novel is intensely engaging in many ways: It is an espionage thriller, and it is also an allegory, a magical realist tale, a love story, a tragedy and an impassioned cry for peace, its many shifts of scene laced with material from Englander’s own life and moments of humor too.

Z, a less agile agent than James Bond, says that during his training, an instructor told the recruits, “the biggest challenge at a Jewish spy service is training everyone not to look so guilty. A less nervous nation might, as the anti-Semites believe, truly take over the world.”

Through separate chapters, Prisoner Z’s story unfolds alongside the story of the General, an unnamed Israeli leader suspended in a coma for many years. Resembling Ariel Sharon, the General is watched over by Ruthi, the personal assistant who attended to the details of his life when he was a vibrant leader, and now praying that he will return to finish what he began. Only she would notice moments when his consciousness seemed to be “rolling in, like a storm coming through.” The reader is privy to the General’s dreams of the wars in which he served, his encounters with Ben Gurion, Dayan and Peres, his heroic moments and near escapes. As Englander writers, all of this “takes place outside of language, and outside of thought, assembled in another kind of consciousness.”

The novel is intensely engaging in many ways: It is an espionage thriller, and it is also an allegory, a magical realist tale, a love story, a tragedy and an impassioned cry for peace.

Other characters include an Israeli waitress in Paris who becomes someone else, a Palestinian who aids his people’s cause from Europe, the guard, who is the son of Ruthi, a Palestinian mapmaker, and Prisoner Z in other guises. Englander succeeds in making us care about all of them.

In an interview, Englander, 47, riffs on questions of identity, empathy, justice, tangled truths and peace, themes that have run through some of his earlier works, including the novel “The Ministry of Special Cases,” the story collections “For the Relief of Unbearable Urges” and “What We Talk About When We Talk About Anne Frank,” and his play, “The Twenty-Seventh Man,” which premiered at the Public Theater in 2012.

He was in part inspired by a newspaper story he read about five years ago while in Israel about the story of Prisoner X, a young man who disappeared in the Israeli system, who only had an identity when he killed himself in his cell.

“He didn’t live until he was dead. He didn’t have a cell until the moment of his hanging. That sent my head spinning.” Englander felt connected to this man’s personal story, of an Australian who chose to move to Israel, “to adopt the belief system, join the Mossad, go under deep cover and then become a traitor. We all know that some people become traitors, for failures in character or greed or bribery, so many reasons, I thought. I really wanted to tell a story of empathy. What if he flipped for empathy? What if a guy like me was in the Mossad and flipped for empathy?

“Empathy is what obsesses me. And watching empathy recede in the world is terrifying,” he says.

Englander lived in Israel from 1996 to 2001, a time when peace seemed possible. He has been thinking about this novel since those years. About why he waited until now to write it, he says, “It just feels more and more pressing, more urgent as the world turns fractious, as new walls keep going up.

“Empathy is what obsesses me. And watching empathy recede in the world is terrifying,” he says.

“It’s not only about timeliness. It’s that I wanted to find a way to tell it right. I didn’t want a didactic book; I didn’t want to lecture. This is so heartfelt — I waited for the moment, for near 20 years, until I found the right story and structure.

“It goes back to my yeshiva education, to me writing sentences with a kind of spiraling structure,” he says. Englander recalls that when he first went to study at the Iowa Writer’s Workshop, his teacher, novelist Marilynne Robinson, suggested that his sentences contained everything he wanted to say, but they were somehow moving in concentric circles and backwards.

“I realized I was writing English in Yiddish. That was how I learned to communicate.”

Courtesy of Knopf Publishing.

In this beautifully written book, he has learned to control his circles, and there are many: cycles of violence, many different threads, multiple time lines, various genres, separate realities. There’s a lot of looping back and ahead, echoes, doubles, mirrors.

“This whole book is like the Hebrew term, Hafukh al hafukh, turning something upside down and around again. Even the opposites have opposites.”

Englander spent last year in Malawi, where his wife was doing Ph.D. research. (She’s pursuing a joint degree in educational policy studies and anthropology.) “I was writing fiction and drawing on memory and my understanding of history. My day-to-day reality was so foreign, and that triangulation — living in the fictional world of the novel, and drawing on memory, which is its own kind of world, while living in a place where everything for me was new, really helped with the rewrite. I was inhabiting a new reality while shaping other realities — it was the only way this book got written.

“This whole book is like the Hebrew term, Hafukh al hafukh, turning something upside down and around again. Even the opposites have opposites.”

He’s admittedly a private person, but in this book more than his previous novels and stories, his childhood memories are less veiled. He says he now has enough distance to write a book like “Dinner at the Center of the Earth.”

“I used to have to set things far away, to write close. With each book, I’ve found myself more and more able to draw off the personal, and still be as vulnerable as I need to be as a writer.”

Prisoner Z recalls being a boy in West Hempstead, walking home and seeing a bunch of tough kids on “the street where the anti-Semites live.” His identity is “that of a tantalizingly beat-up-able religious Jewish child, with a yarmulke pinned” to his head. With a studied motion, he lifts his hand as though to smooth his hair, and slips the yarmulke into his pocket. In a recent Op Ed in The New York Times, written after events in Charlottesville, Englander also referenced the anti-Semitic experiences of his childhood.

A fifth-generation American, Englander says he’s thinking a lot about identity. In earlier years, he didn’t like being labeled a Jewish-American writer, but these days, with the rise of white supremacy, he’s OK with the label. “I feel more and more Jewish — I’m now wearing 10 yarmulkes when I talk to you.

“… To me Jewish is the normal way to be, it’s not a type of being.”

“I understand if everyone looking at me is seeing a Jew, and seeing me as a kind of ‘other.’  But I can’t be expected to see myself that way. That is, to me Jewish is the normal way to be, it’s not a type of being.”

He says, “I grew up religious and stories are how I make sense of things — I understand the world through metaphor.

“Both sides win by losing, people will have to make sacrifices. ‘Winning’ for either side would mean some horrible outcome that I don’t want to envision. I grew up with the idea that Israel was surrounded by enemies trying to push it into the sea. Can’t the people of Gaza feel that they’re surrounded by enemies who want to push them into the sea too? All the metaphors are interchangeable. All of them flip. Hafukh al hafukh.”

Englander conjures up a scene in which Ruthi remembers “one of the numberless late nights at the General’s official residence, all but her, and his bodyguards, sent home, when she is asked to put together an impromptu supper for the General and a guest, who turns out to be Arafat. “My favorite enemy has stopped by for a chat,” the general says. The pair shares Ruthi’s simple meal — not the meal referred to in the title, that is savored by others, elsewhere — in the kitchen, and reminisce over the many times they’d tried to kill each other and failed before moving on to a question of land for peace. 

At Joe’s Pub at the Public Theatre last month, Englander launched the book with a reading and spoken-word performance drawn from the book, from parts drawn from his life. He’ll be doing similar performances and readings in several New York venues, including Symphony Space, 2537 Broadway, in conversation with Mira Jacob, on Oct. 16 ($26), at The Jewish Theological Seminary, 3080 Broadway on Oct. 18 (free; reservations required, publicevents@jtsa.edu) and at 92nd Street Y, 1395 Lexington Ave. with Jennifer Egan on Nov. 30 ($22 and up).