Mention the writer W. Somerset Maugham and the name might evoke a fond recollection of his most popular novels, Of Human Bondage, The Moon and Sixpence, and The Razor's Edge. Maugham's critical self-assessment — possibly apocryphal — may also come up. The story goes that he placed his work "in the very first row of the second tier."

In fact, Maugham (1874-1965), who plays a central role in Tan Twan Eng's entrancing new novel, The House of Doors, is an inspired choice for a character. Tan's narrative, set largely in 1921 in Penang, in the Federated Malay States, reimagines Willie Maugham's two-week stay with his "secretary" and longtime clandestine lover, Gerald Haxton, at the stately waterfront home of an old friend from London, the lawyer Robert Hamlyn, and his wife, Lesley.

The visit, intended as an opportunity for the famous author to rest after physically taxing travels around Asia — and to further avoid his wife in London, whom he never should have married — turns out to be less relaxing than he'd hoped.

Willie, ever on the lookout for new material, sees his hostess as yet another "woman in the colonies stuck in an unhappy marriage." Lesley's husband Robert, 20 years her senior, suffers from the effects of gas poisoning from his service in WWI. To her consternation, he wants them to move to his brother's sheep farm in South Africa in the hopes of improving his health in a less humid climate.

Their astute houseguest senses that more is amiss than Robert's health. He suspects that Lesley may have had an affair with the Chinese revolutionary Sun Wat Sen when he was in Penang in 1910 raising funds for his cause, a frequent subject of her conversation.

Despite her husband's warnings to watch what she says to Willie — "He's my friend, but he's also a writer, and there's nothing he loves more than snuffling out people's scandals and secrets" — Lesley eventually lets down her guard. Her tale about how learning the truth behind her husband's infidelity freed her for the great love of her life is catnip to her celebrated houseguest — and the reader.

Lesley knows she is putting herself and her marriage at risk — and also betraying a close friend, Ethel Proudlock, who (in an actual case) was tried in Kuala Lumpur in 1911 for murder. Ethel claimed self-defense from attempted rape, but things were more complicated; as she confided to Lesley, she was actually having an affair with the victim.

The House of Doors, longlisted for this year's Booker Prize, is lushly atmospheric. Tan, the author of the Booker Prize-shortlisted The Garden of Evening Mists, writes of whisky stengahs, gin pahits, and dhobis, syces, kebun (all words for servants). Landscapes are filled with screeching wild monkeys, fragrant frangipani flowers, and whispering casuarina trees, which later provide the title for Maugham's 1926 short story collection set in Malay.

Tan's verbs are aerobically active: a breeze pawed at the curtains of Gerald's room; wind frisked the upper branches of trees; dusk rouged the sky; the morning decanted its light down distant mountain slopes.

But too often — particularly at the end of chapters — Tan goes too far, beyond rouge to purple. He mars an otherwise lovely skinny-dipping scene in a sea lit up with plankton by tacking on unnecessary footnotes (literally): "That night, side by side, we drifted among the galaxies of sea-stars, while far, far above us the asterisks of light marked out the footnotes on the page of eternity."

The House of Doors encompasses at-the-time risky interracial and homosexual love stories, a scandalous murder trial, and a paean to the art of transforming life experiences into literature. When Lesley takes Willie to task for always writing about unhappy marriages and adulterous affairs, he says, "I write about the human weaknesses that created these unhappy marriages — cowardice, fear, selfishness, pride, hypocrisy." As for having used the prostitute Sadie Thompson's real name in his notorious 1921 story "Rain," Tan has the writer say he did so because he admired her lack of hypocrisy — unlike most people, including himself.

There's much to untangle and savor in this exquisite novel, including the symbolism of the titular doors and the significance of Reynaldo Hahn's musical composition based on Paul Verlaine's poem "L'heure exquise" ("The Exquisite Hour").

But for me, especially upon re-reading Maugham's The Casuarina Tree, I was struck by Tan's audaciousness in manipulating Maugham's stories in the interests of literature in much the same way that Maugham himself had fed his fiction by manipulating the stories people told him during his travels.

A story called "P. & O." (short for Pacific and Oriental), for example, features a 40-year-old woman named Mrs. Hamlyn who, unlike Tan's Lesley Hamlyn, is unhappily headed to a much-reduced life in England after learning of her husband's love affair with an older woman. "The Letter" is Maugham's take on the murder trial of Ethel Proudfoot, whom he renamed Leslie Crosbie, wife of Robert Crosbie.

Tan's heroine, Lesley, notes with a mixture of relief and pique that both of these stories diverge significantly from the events she recounted to Willie in 1921. What is so intriguing about this situation is that we somehow accept Lesley's version as what really happened, though in fact Tan has borrowed names and details from Maugham's work to seed The House of Doors and his heroine's stories. In doing so, Tan has pulled off not just a captivating novel, but an ingenious twist that explores how literature works its magic.

Copyright 2023 NPR. To see more, visit https://www.npr.org.