Margaret York, a homicide detective who helped inspire the 1980s Emmy-winning police drama "Cagney & Lacey," and who rose to become the highest-ranking woman in the Los Angeles Police Department, died Oct. 17 at a Los Angeles hospital. She was 80.

The cause was a series of illnesses, said her husband, Judge Lance Ito, who gained national prominence presiding over the O.J. Simpson criminal trial.

In almost four decades with the LAPD, York broke numerous glass ceilings and in 2000 was the first woman to be named deputy chief, making her the highest-ranking woman on the force. She retired in 2002.

While working homicide in the 1970s, she was paired with Detective Helen Kidder — mainly, both said, because the men in the department didn't want to work with a woman. This left them partners by default and inadvertently created a groundbreaking team of an all-female homicide unit.

By 1980, they were attracting attention for their crime-solving skills, which included helping to find the perpetrators of a notorious series of slayings on the Sunset Strip.

All this proved irresistible to TV producers, who took the rare combination of two female detective partners in Los Angeles, transplanted them to the New York Police Department, glammed them up and made a fast-paced series called "Cagney & Lacey." In the show, just as in real life, the women battled sexism on the force as much as they fought crime.

The series — in which Tyne Daly portrayed Mary Beth Lacey, the character based on York, and Sharon Gless played her partner, Christine Cagney, based on Kidder — ran from 1981-88 on CBS and won multiple Emmy Awards.

"We were big news because nowhere else in L.A. County were women working homicide," Kidder, now retired from the force, said in an interview. For a time the two were known for having the department's highest rate of solving crimes and extracting confessions.

"These people either look at us as a mother figure," York told the Los Angeles Times in 1993, "or they think we are too stupid to know what to do with the information."

Kidder said she thought the pair obtained so many confessions because they had actually listened. "We didn't start putting words in their mouths," she said. "We gave them a chance to tell their stories."

York wasn't thrilled with the series, telling the Los Angeles Times in 1982 that in its earliest iteration "Cagney & Lacey" depicted "two women trying to do exactly what men do," rather than showing the special skills and attributes that women could bring to the job.

But the show contributed to a national conversation, fueled by sex discrimination suits and consent decrees, about whether women could and should be police officers.

Even after the show was overhauled and started winning awards, York rarely watched it. "She was a mother and a busy professional," Ito said in an interview.

Margaret Ann Mandley was born Aug. 4, 1941, in Canton, Ohio. Her first marriage, to Donald York, ended in divorce. She found work with the Los Angeles Police Department as a single mother of three looking to support her family, starting as a civilian radio telephone operator in 1965. After attending the police academy, she became an officer in 1968.

"She joined policing at a time when policewomen were faced with seemingly insurmountable obstacles," LAPD Chief Michel Moore said.

Back then, women on the police force could work only desk jobs or in jails. They were assigned the lowest-level detective work, could not be promoted beyond the rank of sergeant and could supervise only other women. York helped change the culture. Women are now eligible for all ranks and assignments. Today they make up 18% of officers on the force, a figure higher than the national average of less than 13%.

York met Ito in late 1980, when he was a deputy district attorney in Los Angeles. Both had been called to the scene of a homicide at 3 in the morning. They met "over a dead body," he said, recalling that he had been impressed with her but that she hadn't paid him any attention.

They crossed paths a couple of months later, in 1981, and within less than a year of their first meeting they were married.