It was one of the most notorious murders of its age. Galvanizing early 20th-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, his account of this murder was no Sherlock Holmes tale. 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 his 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 Glasgow woman. Just before Christmas 1908, Marion Gilchrist, a furtive 82-year-old who kept a vast collection of jewels secreted in her flat, was found brutally bludgeoned to death. The police declared that robbery was the motive, for Miss Gilchrist’s maid told them that a prized brooch — a gold crescent moon set along its length with diamonds — was missing.

Oscar Slater, 1908. Photo by Hulton Archive/Getty.

Glasgow police detectives soon settled on a suspect: 36-year-old Oscar Slater, a German Jewish cardsharp recently arrived in the city who was reported to have pawned a diamond crescent brooch. Under pressure to close the case — and happy to rid Glasgow of an immigrant Jew of dubious livelihood — they pursued him nearly into the grave. With Miss Gilchrist’s maid and two other witnesses in tow, they followed Slater by ship to New York, where he had sailed on a long-planned voyage, and extradited him to Scotland. His very name would become so notorious there that for years afterward the phrase “See you Oscar” was Glasgow rhyming slang for “See you later” — as in “See you later, Oscar Slater.”

In May 1909, after a jury deliberated for barely an hour, Slater was found guilty and sentenced to death. The pro­nouncement had a terrible finality: There was no criminal ap­peals court in Scotland then. (Pardons, when they were occasionally granted, were by prerogative of the British mon­arch.) There was enough public unease about the verdict, however, that a petition for clemency garnered 20,000 signatures. Forty-eight hours before Slater was to mount the scaffold — he had already made arrangements for his own burial — King Edward VII commuted his sentence to life at hard labor.

For the next 18 and a half years, Slater 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, a stark Victorian fortress erected in 1888. 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 20-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 managed to smuggle out of prison in 1925. That message — an impassioned plea for help — was directed at the one man he believed could save him: Arthur Conan Doyle.

Sir Arthur Conan Doyle, 1925. Photo: General Photographic Agency/Getty

Writer, physician, worldwide luminary, champion of the downtrodden, Conan Doyle had believed in Slater’s innocence almost from the start. First 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.

That the story does 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” — invoking the great writer’s support for Alfred Dreyfus, a Jewish officer in the French army falsely convicted of treason in 1894 amid a climate of roiling anti-Semitism.

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 71, 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 wrongful conviction born of bigotry, 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 inspired Julian Barnes’ acclaimed 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, the press and public were inclined to regard any cause to which he attached himself, Slater’s included, with skepticism, if not out­right 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 readi­ness to wade into battle, a sense of honor so intense that it trumped personal antipathies, and a talent for rational investi­gation 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.

A courtroom scene of Slater’s trial, 1909. Photo by Hulton Archive/Getty.

In late 1911 or early 1912, Slater’s lawyers asked Conan Doyle to lend his support to their cause. Though he deplored Slater’s ungentlemanly life, Conan Doyle, a Scotsman himself, soon came to believe that the case was a stain on the British charac­ter. Training a Holmesian eye on every facet of the crime, manhunt, and trial, he scoured police reports, witness statements, and courtroom transcripts with a rigor born of his diagnostic training. Conan Doyle’s method entailed the search for small details whose significance other investigators had missed, the picking apart of logical inconsis­tencies 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.

As Conan Doyle would help expose, the case against Slater was rife with judicial and prosecutorial misconduct, witness tampering, the suppression of exculpatory evidence, and the subornation of perjury. It was, he declared, a “disgraceful frame-up, in which stupidity and dishonesty played an equal part.” To begin with, the police knew within a week of fingering Slater that he was not their man: Miss Gilchrist’s missing brooch was set with a single row of diamonds, whereas Slater’s — pawned more than a month before the murder — had three. At Glasgow police headquarters, they convened a lineup in which the dark-haired, olive-skinned Slater was paraded before witnesses beside 11 other men: nine pale-pink Scottish plainclothes policemen and two pale-pink Scottish railway officials. (The net effect, one Scottish journalist wrote acidly years later, was “like attempting to conceal a bulldog among ladies’ poodles.”)

Then there was the matter of the murder weapon. In Slater’s shipboard luggage, police found a small inexpensive hammer — not much bigger than a tack hammer. With it, they argued, he had caused Miss Gilchrist’s devastating injuries. (Miss Gilchrist had been so savagely beaten that autopsy photographs depict a face that looks as though it had never been human.) Although the first doctor to examine the body at the scene had asserted that a hammer of that size could never have caused injuries on that scale, he was never called as a witness at Slater’s trial.

Even worse, immediately after the murder, Miss Gilchrist’s maid told the police that she had seen another man — a prominent member of Glasgow society — leaving the scene of the crime. That testimony, too, was suppressed by the prosecution.

The hammer produced in court as evidence during the trial of Slater, 1909. Photo by Hulton Archive/Getty.

In The Case of Oscar Slater, his scathing 1912 indictment of the affair, Conan Doyle set forth the unimpeachable conclusion that Slater had been framed. But he soon discovered, he wrote, that “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 day. Slater’s urgent smuggled message of 1925 — a tightly furled paper pellet tucked beneath the dentures of a paroled fellow convict — moved Conan Doyle to take up the case one final time. In 1927, his work won Slater’s freedom at last.

A question that vexed Slater’s advocates throughout his ordeal has persisted for more than a century: Why, when the police knew that he was innocent, did they pursue him all the same? The answer reveals much about the state of criminal investigation at the dawn of the 20th century: Slater’s case took place at a watershed moment in criminology, a time when the identification of criminal suspects was rooted unapologetically in prejudice of every sort — focused, as one present-day scholar has written, on “the kinds of criminal behavior embedded in particular racial characteristics.”

It also reveals much about the Victorian mindset, for the Slater affair, which straddles the twilight of 19th-century gentility and the upheavals of 20th-century modernity, is at its core a tale of Victorian morality. Though the case began in Edwardian times and ex­tended into the Jazz Age, it is indisputably a product of what has been called “the long 19th century,” which ran to the outbreak of World War I and perhaps even beyond. As it unspooled over two decades, the story encapsu­lated much that was commendable about the ethos of the period — valor, fair play, and increasing fealty to scientific reason — and much that was not: class bias, sexual prudery, xenophobia, na­tionalism, and anti-Semitism.

In the end, Slater — in many ways an immigrant Everyman — was doubly marginalized: first by the bigotries that conspired to convict him, and afterward by history. In the few previous accounts of his case, Slater himself is a conspicuous absence, a cipher at the center of his own story. But his correspondence with three generations of his loving family in Germany — a bulging file containing every letter he sent and received in his nearly two decades in prison — has been preserved in Scottish archives, and it yields a bittersweet bonanza.

In it 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. “I am feeling very depressed & low-spirited,” Slater wrote to his sister. “During the eighteen years I have been in prison I have only had one Jewish service. Every convict prisoner in England enjoys a weekly service in his own particular religion. I am broken and have grown old and need very badly spiritual learning & guidance.”

Oscar Slater at Westminster following his release from prison 19 years after he was wrongly convicted, 1928. Photo by Davis/Topical Press Agency/Getty

We also see a man torn between the need to resign himself to his fate and the need not to abandon hope altogether. “Dear parents, do not grieve, this makes me still far unhappier than I am al­ready,” Slater wrote in another letter. “To keep up my senses I try now always to think, It must be so.”

And we see, hauntingly, a man who appears to be descending into madness. “It is against humanity what was done against me, kindly listen,” he wrote, in his imperfect English, in a paranoid letter to a prison overseer. “On the 21 of March…drugs between my cough mixture have been given to me, to drink and for 36 hours I was madly raving in my cell and still it is not out of my bones and brain altogether…This is more than murder and I must respectfully ask for your aid.”

More haunting still is the fact that even after his release in 1927, 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 him from the terrible wartime fate his family met.

At bottom, the Slater case is a story about class identification: those snap judgments, themselves dark diagnostic instruments, that in every age are wielded to segregate “us” from “them”—the shape of a nose, the lilt of a voice, the hue of the skin. 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 passions and prejudices, this 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 my book about the case 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.

From the book CONAN DOYLE FOR THE DEFENSE by Margalit Fox. Copyright © 2018 by Margalit Fox. To be published by Random House, a division of Penguin Random House LLC.