Given the sublime recent reinventions of Henry James (by Colm Toibin and David Lodge) and Arthur Conan Doyle (by Julian Barnes), it's not a surprise to find another real-life writer recruited into the fictional ranks. But adopting Oscar Wilde as a protagonist is a riskier shift, particularly because Gyles Brandreth is inserting his hero into a detective fiction.

Since his death in 1900, the great Irish wit has gone from depraved monster to martyr in the public eye, from a man with a wild appetite for rent boys to a victim of late-Victorian hypocrisy. But whatever improprieties he committed in life, Wilde's plays are regularly revived and his novel, "The Picture of Dorian Gray," is still very much read. And many would give anything to match even one of the thousands of maxims he seemed to toss off with ease.

Wilde's waggish claim that "life imitates art far more than art imitates life" could have haunted Brandreth's mystery featuring his hero as a Holmesian problem solver with a few problems of his own. But "Oscar Wilde and a Death of No Importance" is an intriguing tightrope walk, the first in what he hopes will be a nine-book series.

The mystery purports to be an unpublished memoir, circa 1939, by Robert Sherard, who for 50 years had kept his promise to Wilde not to reveal one particular tale. But now that war threatens and his great friend has been dead for almost four decades, Sherard must bear witness.

On Aug. 31, 1889, it transpires, Wilde came upon the dead body of Billy Wood, a 16-year-old prostitute he had taken under his wing. Despite knowing that he will be undone by any public revelations of this ritual murder, the extravagant and mercurial Wilde is determined to bring the boy's killer to justice. Unfortunately, when he and another friend -- Arthur Conan Doyle! -- return with Sherard to the scene of the crime near Westminster Abbey, the room has been swept of everything: body, blood, furniture. What's more, a highly placed police detective and acquaintance of Conan Doyle appears to be doing his best to scuttle an investigation.

If anything, this makes Wilde even more determined: "Ennui is the enemy, Robert! Adventure is the answer. We shall find the murderer of Billy Wood. If Conan Doyle's friend cannot help me, Conan Doyle's example can. Oscar Wilde masquerading as Sherlock Holmes -- why not? A mask tells us so much more than a face."

Over the course of Brandreth's engaging, often ingenious melodrama -- which comes with such Dickensian grotesques as a drunken seaman, a dwarf who seems to have it in for Wilde and a grieving mother who is less forthcoming than she claims -- Sherard plays Watson to his friend's Holmes. There are all the staples of the early detective novel: dark London nights; a woman wronged, another incapable of escaping her fate; clubs and champagne; devoted, understanding wives. And yes, there is more than one delicious scene in which even Conan Doyle is astonished by Wilde's powers of observation and deduction.

But as the plot thickens and aphorisms and suspects pile up, Brandreth has more in mind than entertainment. Along with the narrator, he seems intent on redeeming Wilde, to the point of whitewashing his hero's life and predilections. (He would do well to heed Graham Greene's advice, "Innocence is a tricky subject: Its appeal is not always quite so clean as a whistle.")

Had "Oscar Wilde and a Death of No Importance" appeared without its extensive armamentarium -- including a guide to Brandreth's works (fiction for adults and children, biography, essays and autobiography, nonfiction and theater), an interview and reading group tips -- you probably wouldn't be prompted to look beyond it. But readers may be surprised to learn that Sherard did, in fact, exist and, though things with Wilde ended badly, published three memoirs of his friend.

Judith Thurman has claimed that "novel-writing seems to be a work of high-minded betrayal and biography a work of dirty-minded fidelity." There may be such a betrayal in Brandreth's sanitized adventure, but his portrait of Wilde as "a man of rare heart and rarer genius" is also a pleasure.

Kerry Fried also has reviewed for the New York Times, the New York Review of Books and the Boston Review.