Sue Grafton in 2002. (Bryan Chan/For The Washington Post)

Sue Grafton, a best-selling crime novelist whose popular “alphabet” mysteries featuring Southern California detective Kinsey Millhone sold millions of copies worldwide, died Dec. 28 in Santa Barbara, Calif. She was 77.

She had cancer, her daughter Jamie Clark wrote on the author’s website.

Ms. Grafton published the first of her alphabetical series of novels — each title began with a different letter — with “A Is for Alibi” in 1982. She reached the 25th letter of the alphabet with her final book, “Y Is for Yesterday,” which was published in August.

After publishing two novels in the 1960s, Ms. Grafton later wrote screenplays before breaking through in the 1980s with her mystery books, which became instant bestsellers. Her experience as a screenwriter and studio office worker gave her such a strong distaste for the ways of Hollywood that she refused to allow any of her Kinsey Millhone books to be made into films or television productions.

“My goal in life,” Ms. Grafton once said, “is to write one perfect mystery.”

Sue Grafton in 2001. (Jonathan Alcorn/For The Washington Post)

Her heroine, Kinsey Millhone, is a witty, tough-talking detective who was orphaned at 5 and whose emotional vulnerabilities are sometimes woven into the plot. Ms. Grafton considered Kinsey her alter ego — “well, not even very alter,” she added.

The books, published in dozens of languages, earned Ms. Grafton a large and devoted readership, particularly among women.

“I’ve come to believe,” critic Patrick Anderson wrote in The Washington Post in 2005, “that she is not only the most talented woman writing crime fiction today but also that, regardless of gender, her Millhone books are among the five or six best series any American has ever written.”

During the 35 years that Ms. Grafton wrote about Kinsey Millhone, the character aged only seven years, from 32 to 39. At the beginning of many of the books, Kinsey provides a revealing self-assessment that, over the course of 25 novels, adds up to one of the most endearing, vivid and memorable characters in modern crime fiction.

In “G Is for Gumshoe” (1990), she notes: “My usual practice is to crop my own mop every six weeks or so with a pair of nail scissors. This I do because I’m too cheap to pay twenty-eight bucks in a beauty salon. I have hazel eyes, a nose that’s been busted twice, but still manages to function pretty well, I think. If I were asked to rate my looks on a scale of one to ten, I wouldn’t.”

In “P Is for Peril,” from 2001, she tells a little more about herself:

“I’m female, 36, twice divorced, childless and otherwise unencumbered . . . . I was a cop for two years early in my twenties, and through personal machinations too tedious to explain, I realized law enforcement didn’t suit me. I was way too crabby and uncooperative to adjust to department regulations . . . . Plus, the shoes were clunky and the uniform and the belt made my ass look too wide.”

Kinsey drives a VW, likes junk food and carries a gun.

Ms. Grafton studied the works of earlier mystery writers, including Raymond Chandler, Dashiell Hammett and especially Ross Macdonald, and considered herself a direct descendant of mystery-writing royalty.

“I want to be the king of American mysteries,” Ms. Grafton told the Chicago Tribune in 1992. “Not the queen, please. I want to be the king.”

By the time she got halfway through the alphabet, Ms. Grafton may have earned her crown. Her publishing advances were in the millions of dollars, and each new novel had a hardcover print run of 500,000 copies or more. She lived on a multimillion-dollar California estate, in far more lavish surroundings than the garage apartment her heroine could afford.

Most of Ms. Grafton’s books are set in California in the 1980s — Kinsey lived in Santa Teresa, a fictional California town that Macdonald created for his Lew Archer series of detective novels — but at times they range deep into the past. Ms. Grafton examines human character as deeply as any clues that might solve a crime. Critics noted that the stories often had an undercurrent of tender observation seldom found in the hard-boiled fiction of male writers.

In “U Is for Undertow” (2010), a chubby boy, mourning the death of his mother, eats a cold grilled cheese sandwich: “Because of his braces, he couldn’t bite down on a sandwich without getting bread sludge stuck in the wires, so he broke off bites one at a time, thinking of her.”

Sooner or later, however, Kinsey Millhone straightens her shoulders and gazes at her world with a clear, hard look of fatalism. While snooping around nursing homes in “G Is for Gumshoe,” and encountering too many dead-end lives, she says, “Maybe I’d get lucky and be struck down by a beer truck before I was forced into such ignominy.”

Sue Taylor Grafton was born April 24, 1940, in Louisville. Her father was a lawyer who wrote mystery novels, her mother a chemistry teacher. Both were alcoholics.

“Every morning,” Ms. Grafton wrote in her autobiographical 2013 book, “Kinsey and Me,” “my father downed two jiggers of whiskey and went to the office. My mother, similarly fortified, went to sleep on the couch. From the age of five onward, I was left to raise myself, which I did as well as I could, having had no formal training in parenthood.”

Ms. Grafton first married at 18. She had two children and was divorced before she graduated from the University of Louisville in 1961.

Her first two novels were set in Appalachia, and one of them, “The Lolly-Madonna War,” was made into a 1973 film starring Rod Steiger and Jeff Bridges. She moved to Hollywood, wrote screenplays and held secretarial jobs in film studios.

Ms. Grafton’s second marriage ended in protracted divorce and custody proceedings that, she later said, led her to imagine methods of murder for her novels.

“We all think about murdering another person on occasions,” she told the Guardian in 2013. “What matters is not acting on that impulse. I’m lucky to have fictional characters to do it for me.”

Survivors include her husband of more than 40 years, philosophy professor Steve Humphrey of Santa Barbara; two children from her first marriage; a daughter from her second marriage; a sister; four granddaughters; and a great-grandson.

Ms. Grafton was one book away from completing the final Kinsey Millhone installment, which would have been called “Z Is for Zero.”

“As far as we in the family are concerned,” her daughter Jamie Clark wrote on Ms. Grafton’s official website, “the alphabet now ends at Y.”