In the late 1970s, after almost two decades of laboring to write a second novel that might live up to her first, Harper Lee turned to nonfiction.

Her debut, “To Kill a Mockingbird,” had been published in 1960, winning the Pulitzer Prize and becoming one of the country’s most beloved novels, as well as the basis for one of its most beloved films. In the intervening years, as Casey Cep writes in her own debut, “Furious Hours: Murder, Fraud, and the Last Trial of Harper Lee,” Lee published hardly anything: “three short essays for two glossy magazines, two tiny profiles that were favors for her friend Truman Capote, one satirical recipe for crackling bread in a novelty cookbook.” But now she latched onto another Alabama courtroom story, one that might speak, the way “Mockingbird” had, to issues of race and justice. The difference was that everything about this case was real.

Lee spent many years working on the project, but it never saw the light of day. Instead, more than four decades later, we have Cep’s absorbing new volume, which succeeds in telling the story that Nelle Harper Lee could not and offers an affecting account of Lee’s attempt to give meaning to a startling series of events.

“The defendant was black, but the lawyers were white, and so were the judge and jury,” writes Cep about the 1977 trial that fascinated Lee. It sounds familiar. Yet in this instance there was no doubt that the man being tried for a violent crime had done it. On June 18 of that year in Alexander City, Ala., Robert Burns, an African American Vietnam vet, walked into the funeral of a teenage girl named Shirley Ann Ellington and, in front of 300 witnesses, shot the Rev. Willie Maxwell three times.

Many people thought Maxwell deserved it. Some even felt relief. The son of a black sharecropper who became a Baptist preacher and businessman, Maxwell was known as fastidious, charismatic and hard-working. But within the space of several years, his first wife, his brother, his second wife, his nephew and his adopted daughter, Shirley, had all died under mysterious circumstances. He had long been suspected of murder, as well as voodoo (as means) and life insurance fraud (as motive), and had only beaten certain charges against him thanks to the ambitious energies of a white lawyer named Tom Radney. For his part, Radney believed deeply in the values of liberalism, had tried to advance them as a state senator, and had his life threatened because of it. He also had a penchant for profit and a knack for self-promotion. What did he do after Maxwell’s murder? He chose to represent, as Cep puts it, “the man who killed his former client.”

To the potential disappointment of some readers, “Furious Hours” is not structured as a typical murder mystery or courtroom drama. But it’s a rich, ambitious, beautifully written book. A gifted journalist who has written frequently for the New Yorker, Cep has imposed order here by providing biographical portraits of three figures: Maxwell, Radney and Lee. Each section moves the intrigue forward while rendering the lives of these real people, and the forces at work within them, as fully and fairly as possible. Maxwell’s suspicious deeds and Radney’s trial arguments come with background on, for example, predatory insurance practices and electioneering in the George Wallace era. The result is a revealing triptych, one that tells a crime story but also says a great deal about the racial, cultural and political history of the South.

As a portrayal of the life of a writer, the section on Lee is by itself worth the price of admission. She sat in the courtroom for the trial that September, and spent more than a year doing research around Alexander City. She was no stranger to true-crime work, having traveled with Capote — her best pal growing up — on research trips to Kansas for what became “In Cold Blood.” (Providing him with, among other things, 150 pages of meticulous notes, she basically made that book possible.) And yet she struggled with the writing. She struggled with the expectations set by her first book, with depression and with drinking. She also seems to have struggled with how to depict the truth, which is not just stranger than fiction but, especially when compared to the way most mainstream narratives deal with race and racism, also more complex.

Some of that complexity was revealed in 2015 when, with the elderly Lee in a compromised state, the first draft of “To Kill a Mockingbird” was published under the title “Go Set a Watchman” and promoted as its long-awaited sequel. Cep’s view is that despite the problems with its release, “Watchman” depicts Lee’s world more faithfully than “Mockingbird” does; it’s a world where Atticus Finch, the otherwise honorable father figure, is found “participating in the White Citizens’ Council and opposing the work of the NAACP.” But for that early draft to become the kind of book that would go on to sell 40 million copies, those parts had to be cut out.

In the real-life Maxwell case, even after the trial was over, there were no true heroes, no white saviors (real or imagined), no heartwarming, redemptive turns. “Everyone told Harper Lee that the story she had found was destined to be a best seller,” Cep explains. “But no one could tell her how to write it.”

Meanwhile, “Furious Hours” satisfies largely because its third act chronicles the lonely pursuit of such a sympathetic figure. It isn’t clear whether Lee completed a draft or ever entirely gave up on that pursuit. Given that her literary estate was sealed after her death in 2016, we may never know.

John Glassie is the author of “A Man of Misconceptions: The Life of an Eccentric in an Age of Change.”

Furious Hours

Murder, Fraud, and the Last Trial of Harper Lee

By Casey Cep

Knopf. 336 pp. $26.95