It was one of the most notorious murders of its age. Galvanizing early twentieth-century Britain and before long the world, it involved a patrician victim, stolen diamonds, a transatlantic manhunt, and a cunning maidservant who knew far more than she could ever be persuaded to tell. It was, Sir Arthur Conan Doyle wrote in 1912, “as brutal and callous a crime as has ever been recorded in those black annals in which the criminologist finds the materials for his study.”

But for all its dark drama, and for all the thousands of words Conan Doyle would write about it, the narrative of this murder was no work of fiction. It concerned an actual case: a killing for which an innocent man was pursued, tried, convicted, and nearly hanged. This miscarriage of justice would, in Conan Doyle’s words, “remain immortal in the classics of crime as the supreme example of official incompetence and obstinacy.” It would also consume him—as private investigator, public crusader, and ardent nonfiction chronicler—for the last two decades of his life.

The case, which has been called the Scottish Dreyfus affair, centered on the murder of a wealthy woman in Glasgow just before Christmas 1908. The next spring, Oscar Slater, a German Jewish gambler recently arrived in the city, was tried and condemned for the crime. His very name became so notorious that for years afterward the phrase “See you Oscar” was Glasgow rhyming slang for “See you later”—as in “See you later, Oscar Slater.”

But as investigations by Slater’s handful of champions would uncover, the Slater case was rife with judicial and prosecutorial misconduct, witness tampering, the suppression of exculpatory evidence, and the subornation of perjury. It was, Conan Doyle declared, a “disgraceful frame-up, in which stupidity and dishonesty played an equal part.” A good cop sacrificed his career after he voiced deep misgivings about the conduct of the investigation and trial.

In May 1909, after a jury deliberated for barely an hour, Oscar Slater was found guilty and sentenced to death. But amid public unease at the verdict, his sentence was commuted to life at hard labor just forty-eight hours before he was scheduled to mount the scaffold. For the next eighteen and a half years he remained imprisoned, largely forgotten, on a barren, windswept outcropping in the north of the country, in a place that would one day be known as “Scotland’s gulag”: His Majesty’s Prison Peterhead.

Day after day, in bone-rattling cold and blistering heat, Slater hewed immense blocks of granite; endured a Dickensian diet of bread, broth, and gruel; and often languished in solitary confinement. Had he passed the twenty-year mark behind bars, he said, he would have taken his own life.

Then, in 1927, Slater was abruptly released; his conviction was quashed the next year. What set these events in motion was a secret message he had smuggled out of prison in 1925. That message—an impassioned plea for help—was directed at Conan Doyle.

Writer, physician, worldwide luminary, champion of the downtrodden, Sir Arthur Conan Doyle had believed in Slater’s innocence almost from the start. Joining the case publicly in 1912, he turned his formidable powers to the effort to free him, dissecting the conduct of police and prosecution with Holmesian acumen. But despite his influence and energy, Conan Doyle wrote, “I was up against a ring of political lawyers who could not give away the police without also giving away themselves.”

And so a conviction that, as one commentator remarked, rested on evidence so flimsy that in comparable straits “a cat would scarcely be whipped for stealing cream” endured for nearly two decades as one of the most tragically attenuated judicial farces of its time.

That the story did not end with Slater’s death in prison owes chiefly to Conan Doyle. As investigator, author, publisher, and backroom broker in the loftiest corridors of British power, he is credited with having done more than anyone else to win Slater’s freedom in a case that many observers deemed hopeless. “The Slater affair,” one of Conan Doyle’s biographers has written, “was to give Conan Doyle the chance to play a similar part in England to Zola’s intervention in the Dreyfus* affair in France.

Conan Doyle remains venerated today as a crime writer, but he is less well remembered as a crusader—“ that paladin of lost causes,” as one British criminologist memorably described him. By the time he died in 1930, at seventy-one, he had twice run for Parliament (without success) and had championed a string of causes, including divorce reform; the exposure of Belgian atrocities in the Congo; clemency for his friend Roger Casement, convicted of treason; and, in his later years, incongruous as it might seem for a man of such exquisite reason, the existence of the afterlife and the spirit world. Renowned as the creator of Sherlock Holmes, very likely the most famous character in Western letters, Conan Doyle was repeatedly beseeched by members of the public to solve real-life mysteries—deaths, disappearances, and the like—performing successful feats of amateur detection on more than one occasion.

By the time he cast his lot with Slater, Conan Doyle had helped right another notorious wrongful conviction, that of George Edalji, an Anglo-Indian lawyer imprisoned for maiming livestock. Conan Doyle’s personal investigation of that case is the subject of a spate of nonfiction books and also inspired Julian Barnes’s 2005 novel, Arthur and George.

But the Slater story, though it involves homicide, remains less well known, perhaps because the case is more complex than any other Conan Doyle tackled. For one thing, it lacks the stainless suspect and moral absolutes that the Edalji case presented. Where George Edalji was an educated professional man of unimpeachable character, Oscar Slater was an affable Continental rascal: a habitué of music halls and gambling rooms and, it was alleged (though never proved), a pimp. Conan Doyle himself thought Slater a blackguard: “a disreputable, rolling-stone of a man,” he called him seven words that speak volumes about the reflexive cultural assumptions of his era. In addition, Conan Doyle, creator of the ultra-rationalist Holmes, had become something of a laughingstock in the last decades of his life for his vigorous endorsement of spiritualism. As a result, press and public were inclined to regard any cause to which he attached himself, Slater’s included, with skepticism if not outright derision.

Yet the case was Conan Doyle’s last stand as a true-crime investigator, and a remarkable stand it was. The story of his long effort to free Slater throws into relief the singular temperament that let Conan Doyle light the age in which he lived: a readiness to wade into battle, a sense of honor so intense that it trumped personal antipathies, and a talent for rational investigation that far outstripped that of the police. Where today many wrongful convictions have been overturned through DNA analysis, Conan Doyle managed to free Slater with little more than minute observation and rigorous logic—precisely the kind of brainwork that had made his hero world famous.

Conan Doyle for the Defence tells a fourfold story. First, it is the tale of a condemned man exonerated without benefit of modern forensics. Second, it is a study of the singular method of detection that Conan Doyle used in the Holmes stories, applied by him to an actual murder. It is no accident that the man who saved Slater was both crime writer and doctor, for detection, like doctoring, is rooted in the art of diagnosis. That art, which hinges on the identification, discrimination, and interpretation of barely discernible clues in order to reconstruct an unseen past (a skill that Holmes memorably described as the ability to “reason backward”), animates Conan Doyle’s approach to nearly every aspect of Slater’s case.

The diagnostic imagination that Conan Doyle brought to the case had been instilled in him by his medical school professor Joseph Bell, the flesh-and-blood progenitor of Sherlock Holmes. Bell’s tutelage would serve Conan Doyle brilliantly in a string of real-life mysteries, medical and criminal. “I have a turn both for observation and for deduction,” Holmes tells Watson when they first meet. “From long habit the train of thoughts ran so swiftly through my mind that I arrived at the conclusion without being conscious of intermediate steps. There were such steps, however.”

And so there were, too, for Conan Doyle in the Slater case. His published accounts and archived letters on the subject reveal a modus operandi that is truly Holmesian. His method entailed the search for small details whose significance other investigators had missed, the picking apart of logical inconsistencies on the part of police and prosecutors, an eye for negative evidence and the deep understanding of its value, and, as Holmes would have said, the ability to observe rather than merely to see. All this he would use to loosen, link by link, the chain of circumstantial evidence that had been tightened round Slater’s neck.

Third, Conan Doyle for the Defence sketches a portrait of Slater himself, who in the few previous accounts of the case has been a conspicuous absence, a cipher at the center of his own story. This book seeks to fill the void by drawing on the moving series of letters, exchanged over nearly twenty years, between the imprisoned Slater—in many ways an immigrant everyman—and three generations of his loving family in Germany.

The letters yield a bittersweet bonanza. We see a thoughtful, soulful man struggling to hold on to his faith in a place where for much of the time he was the only Jew. We see a man torn between the need to resign himself to his fate and the need not to abandon hope altogether. We also see, hauntingly, a man who appears to be descending into madness. More haunting still is the fact that even after his release Slater would never see his family again: he had lost his German citizenship and could not readily return home. But as painful as this prohibition must have been, in the long run it may well have saved his life.

Fourth, Conan Doyle for the Defence explores a question that vexed many of Slater’s advocates and which has persisted for more than a century: Why, when the Glasgow police knew within a week that Slater was innocent, did they continue to pursue him nearly into the grave?

The answer reveals much about the state of criminal investigation at the dawn of the twentieth century: Slater’s case took place at a watershed moment in criminology, a state of affairs that ultimately worked against him. It also reveals much about the Victorian mindset, for the Slater story, which straddles the twilight of nineteenth-century gentility and the upheavals of twentieth-century modernity, is at its core a tale of Victorian morality. Though the case began in Edwardian times and extended into the Jazz Age, it is indisputably a product of what has been called “the long nineteenth century,” which ran to the outbreak of World War I and perhaps even beyond.

The period saw sweeping social developments including the rise of modern science and medicine, the rise of the modern police force, and the rise of the modern literary detective—an era of which Conan Doyle could not have been more supremely representative had he been assembled by a committee. At the same time it looked longingly backward, to a time when the war’s technologized carnage and other dubious attainments of science were unknown. With his simultaneous embrace of liberalism and traditionalism, and his simultaneous proselytizing for the scientific method and for the existence of a spirit world that many Victorians, amid modern insecurities, had begun to crave, perhaps no public person embodied this Janus-headed era more fully than he.

As it unspooled over two decades, the Slater story encapsulated much that was commendable about the ethos of the period—valor, fair play, and fealty to scientific reason—and much that was not: class bias, sexual prudery, xenophobia, nationalism, and anti-Semitism. Above all, the concern with honor, reputation, and gentlemanly behavior that permeated the age would govern the conduct, noble and otherwise, of many actors in the case, Conan Doyle and Slater included. Their intertwined narrative culminates in 1929, when the association between them, an otherwise curative convergence, ends in what Conan Doyle called “a painful and sordid aftermath,” precisely over a matter of honour.

At bottom, Conan Doyle for the Defence is a story about class identification: those snap judgments, themselves dark diagnostic instruments, that in every age are wielded to segregate “us” from “them.” In particular, Slater’s case is about the ways in which such rude taxonomies—iconographies of otherness—reflect the tenor of their era and the fears of its majority culture. As it played out, his story is also about the manner in which these biases can be enfranchised by legislatures and the courts.

In its confluence of Victorian passions and prejudices, the case endures as a remarkable double faced mirror of its time. What is more (a revelation I had not anticipated when I began work on this book half a dozen years ago), the Slater saga, with its foundational tension between reason on the one hand and the particularly insidious brand of unreason known as ethnic bigotry on the other—manifest in a social practice that has been called “the racialization of crime”—has become every inch a mirror of our own age.

* In 1894, Alfred Dreyfus, a Jewish captain in the French army, was arrested on a spurious charge of treason amid a climate of roiling anti-Semitism. Convicted, he was sent to Devil’s Island, the notorious prison in French Guyana. Among his staunchest public supporters was the novelist Émile Zola, whose outraged open letter, “J’accuse . . . !,” published on the front page of a Paris newspaper in 1898, taxed the government with anti-Jewish bigotry and helped win Dreyfus a new trial. Dreyfus was pardoned in 1899 and fully exonerated in 1906.

This is the introduction to Conan Doyle for the Defence: A Sensational Murder, the Quest for Justice and the World’s Greatest Detective Writer by Margalit Fox (Profile Books, £16.99)