Michael Nava’s novels evoke a period in which Los Angeles—“a brutal place,” “a flimflam town,” “a collection of hostile villages”—was transformed by the emergence of both the Latino and the L.G.B.T. communities as political forces. Photograph by Bruce Davidson/Magnum

In 1986, Michael Nava published “The Little Death,” a mystery novel featuring a detective unlike any previous protagonist in American noir. Gay and Latino, from an immigrant family in California’s Central Valley, Henry Rios is a defense attorney whose hardboiled bona fides—world-weariness, wit, a penchant for erotic entanglement—are accompanied by a hyper-attentiveness to class and a commitment to the poor. In a genre that had used queer people primarily as figures of ridicule and contempt, the Rios books offer a vista on gay lives extending from the closet-lined corridors of power to cruising parks and leather bars. Over the next fifteen years, Nava published six more books in the series. (Open Road Media reissued them as e-books in 2013.) They chronicle a period in which Los Angeles—“a brutal place,” “a flimflam town,” “a collection of hostile villages”—was transformed by gentrification, mass incarceration, riots, gang violence, and the emergence of both the Latino and the L.G.B.T. communities as political forces. Most profoundly for Rios, the city was devastated by AIDS, and what begins as a series of fairly conventional whodunits deepens into what the novelist Christopher Bram has called “a large-scale moral portrait of one man’s life,” a character study of grief, despair, and renewal.

Nava was born in Stockton, California, and grew up in Gardenland, a suburb of Sacramento that he calls “a Mexican village … set down lock, stock, and chicken coop in the middle of California,” where “the air smelled of tomatoes from the Del Monte cannery a few streets over.” His grandparents immigrated to escape the turmoil of the Mexican Revolution, in the nineteen-tens. (Nava revisits this history in his 2014 novel “The City of Palaces,” his first book since the Rios series.) An intelligent and quiet child, Nava retreated from an unhappy household—and from his alcoholic, abusive stepfather—into books, cultivating “habits of secrecy and loneliness,” becoming “a sissy with fangs.” He escaped to Colorado College, where he majored in history, and then to law school, at Stanford. After brief stints working in private firms, Nava realized that “there was no way, as a queer, Latino boy, I could survive in those all male, upper-middle-class, white, élite echelons,” and so he became a prosecutor in Los Angeles, an experience that gives the Rios books much of their finely drawn detail, from the intricacies of courtroom machinations to the “distinctive genital smell” of a county jail. For the past twenty-five years, he has worked for the appellate courts, and he’s now a staff attorney for the California Supreme Court, where he reviews death-penalty appeals.

In essays and interviews, Nava has said that he began writing when he became aware of his sexuality, turning to the page for lack of any other “safe place” to express what he felt. A college literature professor introduced him to mystery novels. “I didn’t realize that mysteries were considered trash,” Nava said to me over the phone last week. “I just thought it was this other kind of literature, and I thought many of them were not only entertaining but quite beautifully written.” Nava first imagined writing his own mysteries when he discovered the work of Joseph Hansen, whose Dave Brandstetter series provided the only example of gay mystery novels with literary aspirations. Nava found in Hansen’s books a model not just for noir writing but for writing about gay life. “Gay literature at that point was mostly about these doomed queens on the East Coast,” Nava told me. “Joe was writing these books about a guy who had a career, who was responsible and decent and didn’t spend his nights taking drugs and dancing.”

Nava also saw in noir a genre equipped to convey the experience of being both queer and Latino in America. “In classic noir novels,” he writes, “you had an outsider hero who embodied the virtues the mainstream pretended to honor—loyalty, courage, ingenuity—but rarely demonstrated.” Much of the pleasure of the early Rios books comes from watching Nava queer noir conventions. In “The Little Death,” Rios worries that a young man is spying on him before he realizes that he’s being cruised; later, the bad guy’s muscle takes the shape of a couple of “Castro clones.” “That was a lot of fun, to turn that stuff on its head, to see the possibility of taking the leggy, breathless blonde and instead of Lauren Bacall, you know, she’s Brad Pitt,” Nava said. In Nava’s novels, sex scrambles the usual categories of the whodunit: victim and assailant, suspect and investigator, and, above all, underbelly and élite. Eros is the great leveller, at least for a moment or two. The function of romance in noir is always to draw the detective into the crime he’s investigating, to implicate him in the narrative he’s trying to construct; in the course of the series, Rios finds himself erotically entangled with at least four suspects. And though at every point he faces hostility directed against his queerness, it also gives him access to a covert network of contacts, bound by an often secret sympathy.

There’s a comfort in the whodunit, with its familiar landmarks: a body, clues, a group of suspects, a tidy ending. It’s a rationalist’s form, both for its faith in the evidence-based logic of investigation and in its promise that the culprit will be not only uncovered but explained, that the horror of violence will be made comprehensible with the revelation of a motive. By “Howtown,” the third book of the series, Nava’s Rios mysteries begin to strain against these expectations. In the later books, the usual rhythms are unsettled by more personal, introspective narrative arcs that extend over multiple novels. The connection of these arcs to the crimes under investigation grows increasingly complex, less a matter of narrative cause and effect than of poetic resonance. Frequently, that connection is structured through allusions to literary models that Nava signals in his titles: a Cummings poem, in “Howtown”; Auden, in “The Hidden Law”; Homer’s Odyssey, in “Rag and Bone.” By the final novel, these secondary narratives have taken on a primary role—the murder victim doesn’t appear until almost halfway through the book. What comes to the fore are Rios’s relationships with his family and the queer and Latino communities, and with the horror wrought by AIDS and by the hatred of gay people that prevented an effective response to the epidemic. Unlike the murders that Rios investigates, AIDS has no motive, and anti-gay animus is seldom easily solved. In confronting them, Nava’s books grow increasingly dark, increasingly angry, and increasingly strange.

The sixth book in the series, “The Burning Plain,” is a harrowing anatomy of queer rage. “It’s a book of despair,” Nava said. The title is a reference to the inner ring of the seventh circle of Dante’s “Inferno,” the desert where sodomites run over burning sands beneath a rain of fire. It is also Nava’s image of Los Angeles. “From the parched hills,” he writes early in the book, “the houses of the rich looked down upon a burning plain.” For the poor, the city is almost apocalyptic, its destitution caught in phantasmagoric glimpses. A homeless person is “a swirl of rags, a baked face.” We see “an enormous, filthy woman lift her voluminous skirts and squat in a weed-choked lot.” Rios is grieving the death of his partner, Josh, to AIDS; the book’s opening finds him in court, sparring with Josh’s parents over the disposition of his remains. (Though Rios is H.I.V.-negative, they accuse him of infecting their son.) In the previous book, the conservative Rios had been impatient with Josh’s participation in ACT UP, and Josh’s growing anger and his need for the company of other H.I.V.-positive men—he dismisses Rios as a “neggie”—eventually drive them apart, if only temporarily. Without Josh to care for, Henry struggles with a fury for which he has no outlet, and it pushes him toward self-destruction.