WEST SACRAMENTO, Calif. (AP) — As darkness falls, the most tattered section of this town’s main drag feels more desperate with each passing hour. Under the cover of night, a slow but steady flow of wandering souls emerges — addicts, prostitutes, drifters. Sergio Alvarez knew the pickings were easy.

As a rookie officer on the West Sacramento police force, Alvarez was assigned to the overnight shift on a beat that included West Capitol Avenue — a one-time Las Vegas-style strip now lined with low-rise motels that rent rooms by the week or the hour.

AT A GLANCE: Recent Cases Of Sex Crimes Involving Police Officers

HOW IT WORKS: A Look At How Each State Handles Officers Decertification For Sex Incidents

Most officers are more than happy to eventually escape the post, but Alvarez volunteered to stay on late-night duty. Over his nearly six years on the job, he gained seniority and almost always patrolled alone. With the solitude came opportunity.

“That’s where Alvarez falls through the cracks,” said Sacramento attorney Justin Gingery, whose firm represented four of eight women who said they were sexually assaulted by the officer, many in the same dumpster-lined alley near “West Cap.” Convicted last year of kidnapping five of those women and either raping them or forcing them to perform oral sex, Alvarez is now serving 205 years to life in prison.

Alvarez is a poster child of a predator cop — and also of the flaws in policies, technological glitches, and culture of policing that can allow such behavior to go unnoticed or unpunished until it’s too late. His case prompted multiple civil claims against his department and the city of West Sacramento over police procedures, with a total of $4.1 million in public funds to be paid to six victims who sued. It also has left a new chief taking a hard look at the way the department does business.

“It hurts the heart to see victims. But it makes it even worse when you are, in one way, shape or form, a contributing factor to them being hurt,” said Tom McDonald, a former captain with the Los Angeles Police Department who took over in West Sacramento after Alvarez’s arrest.

A yearlong Associated Press investigation illuminated the problem of rape and sexual misconduct committed by law officers in the United States, uncovering about 1,000 cops, jail guards, deputies and others who lost their licenses from 2009 through 2014 for such incidents. Most certainly there are even more than that, because some states did not provide records and others, including New York and California, said they do not decertify officers for misconduct.

The International Association of Chiefs of Police spotlighted the issue of sex abuse in a 2011 report prompted by a spate of crimes. The report noted conditions of the job that can create opportunities for officers to take advantage of victims — having authority over others, patrolling alone and late at night, and engaging with vulnerable citizens.

Those issues were hallmarks of the Alvarez case and many others, along with critical breakdowns in policies and procedures. Those include a lack of supervision and training fueled by budget cuts; misuse or malfunction of electronic systems meant to monitor officers; warning signs about potential misconduct that are overlooked; and a good old boy culture in which inappropriate behavior is ignored or even condoned.

A lack of supervision was a major finding in a March Department of Justice report about the San Diego Police Department that some call a blueprint for preventing sexual misconduct. That force has been hit with several incidents in recent years, including the case of 18-year veteran Anthony Arevalos, convicted in 2011 of sexual battery and assault following accusations that he attacked 13 women.

Despite departmental reforms put into place that same year, two more big cases followed. One officer was at the center of a lawsuit brought by a woman who said he groped her and exposed himself in 2013; he left the department with no criminal charges. And last year, former officer Christopher Hays was sentenced to a year in jail and three years’ felony probation after three women said he touched their breasts and other private areas during searches.

The cost to the citizens of San Diego has been significant: The city has paid more than $7 million to settle lawsuits brought by the women in all three cases.

In its investigation, the Justice Department found that budget cuts had hit the San Diego department hard, with staffing reductions a “key problem.”

Nearly a quarter of sergeant positions — considered first-line supervisors — had been filled with acting sergeants who lacked the training and authority of their predecessors. Sergeants also were not always working the same shifts as the people they supervised, and sometimes saw subordinates only once a week, “creating an environment more vulnerable to undetected misconduct,” the report said.

The situation left peers often supervising peers for short stretches, said Jeff Jordon, a sergeant on the force and vice president of the San Diego Police Officers Association. He is hopeful that a new contract with better compensation will cause more veteran officers to stay so the department can improve supervision. But there is much work to do, he added.

“We’re a damaged brand, and we realize we’re a damaged brand,” Jordon said.

Shelley Zimmerman, who took over last year as chief in San Diego, has said that she welcomed the federal review and is now, among other things, requiring patrol officers to wear body cameras to bolster accountability. Overall complaints have dropped 23 percent in three divisions where officers began wearing the cameras in July 2014, she said.

Zimmerman also reinstated an internal misconduct investigative unit, and now requires that more than one officer be present when any women are transported by police.

Police officials often say that the first line of defense in stopping any bad cop is the screening and hiring process. But in the Alvarez case, Gingery said his own investigation on behalf of his clients found nothing about Alvarez’s life before he joined the West Sacramento force that might have foreshadowed the trouble to come.

Alvarez was a hometown boy who graduated from the local high school, got married and worked at a grocery store before being accepted into the police academy. His test scores were average, but his local ties and his ability to speak Spanish made him an attractive candidate for a department trying to build more trust with residents, Gingery said. He also passed a psychological evaluation.

Alvarez joined the department in 2006, but it was only after he had been on the force for a few years that problems started and signs were missed.

In a letter read at the criminal trial, Alvarez’s estranged wife, Rachel, said that she began fearing his unpredictable rage and wondered what had become of the once-adored father of their three children. By 2012, she wrote, “Sergio became a stranger to me.”

That was the same year he found many of his victims, using the power of the badge and any leverage he had — pending warrants, drug possession — to get what he wanted. When there was no dirt, Alvarez kept victims detained until they capitulated.

“The first analogy that came up was the predator that stalks the weak, the sick, the injured — the sociopathic predator mentality that would target those who are already vulnerable,” said Yolo County District Attorney Jeff Reisig, who supervised the case.

Among the victims was a methamphetamine user Alvarez took to the site of several of his assaults — an alley off West Capitol tucked between a wooded area and a strip mall. He told her to wipe off her lipstick before forcing her to give him oral sex, a command she and other victims described in court.

Another woman he targeted was an alcoholic, often seen on the streets collecting bottles, cans and scrap metal for money.

“I remember when I was done, I stood up and I glanced straight at his name tag, and he said, ‘Now everything Mr. Alvarez does is a secret,'” she testified, recalling the first of four sexual incidents with the man she called a “creepy cop.”

The criminal case uncovered several previous red flags: The GPS unit in Alvarez’s squad car was not working, which meant that no one could track or verify his location. He also routinely ignored an order to use the audio-visual recording unit inside his patrol car. The device captures what happens during traffic stops, recording the scene in front of a patrol car and also the back seat — where, in Alvarez’s case, investigators eventually found seminal fluid matching him and the vaginal fluid and DNA of one victim.

Six months before his arrest, Alvarez was reprimanded for failing to use the recording unit whenever he detained someone. Gingery said that, according to Alvarez’s personnel file and depositions in the civil case, the reprimand came after a woman reported that Alvarez had handcuffed her during a stop and forced her to touch his genitals through his uniform. The woman later recanted, however, and investigators had no video.

In a search of Alvarez’s home after his arrest, investigators found a personal “spycam” worn by the officer during some of the assaults. The videos had been deleted, but investigators recovered still images that they reassembled to show graphic sex acts. Alvarez admitted having sexual contact with three of his accusers but insisted it was consensual and testified that he had used the spycam because he was “curious.”

Alvarez did not respond to a letter the AP sent him in prison, and his attorney, J. Toney, said he didn’t want to be contacted about the case. Alvarez has appealed the conviction, claiming the women bribed him with sexual favors to avoid going to jail and were all drug addicts, motivated by civil lawsuits.

Those who study sexual abuse note that such claims about victims are common defenses that can hamper investigations or even stop them from taking place.

“We want to focus so much on who the victim is and what the victim said. … All too often, they are not taken seriously,” said Kimberly Lonsway, research director at End Violence Against Women International, a training organization founded by a former sex crimes detective.

That can be especially true when the offender is a law enforcement officer, often given the benefit of the doubt. So experts advocate heightened supervision and electronic monitoring with body cameras, patrol car recorders and GPS — a key to protecting potential victims, as well as officers who may face false complaints.

Lonsway also recommended so-called “early warning systems” that track all complaints against officers — even unsubstantiated ones — to help find patterns of bad behavior, especially if supervisors change regularly.

Others said that efforts to prevent sexual misconduct must go beyond rules and regulations to address the boys’ club culture of policing.

As an officer in Ocean City, Maryland, Bernadette DiPino encountered what she called a “laissez faire” attitude about sexually inappropriate behavior. DiPino is now chief of the Sarasota Police Department in Florida and helped develop the International Association of Chiefs of Police report on sexual misconduct.

She recalled one patrol officer in the Maryland department who was known for using binoculars to peep in people’s windows while on duty.

“Everybody knew about this guy . but they did nothing to stop it,” said DiPino, who later served as chief in Ocean City.

Attorney Shannon Kennedy said she learned of similar behavior in the case of Michael Garcia, a former sex crimes investigator at the Las Cruces Police Department in New Mexico who is serving nine years for sexually assaulting an underage police intern. Kennedy said the criminal case and a pending civil lawsuit revealed a department rife with sexism and sexual innuendo — crotch-grabbing, porn viewed at work on cellphones, and female employees routinely called “whores” and “bitches.”

Male officers “think this sexual banter is just locker-room culture,” said Kennedy, who represents the victim in the civil case. “They just think it’s funny.” An attorney for the city said neither he nor police officials could respond because of the lawsuit.

One civil lawsuit against West Sacramento, filed on behalf of a mentally ill woman who attorneys say was twice coerced into giving Alvarez oral sex and once was sodomized by him, contended that trading sexual favors to escape charges was so well-known within the 70-member force that officers nicknamed it “tickets for treats.”

The woman’s mother, Heatherlyn Bevard, said in an interview that her daughter, Rebecca, tried to tell a few West Sacramento officers about Alvarez and they “just laughed at her.”

In her letter to the court, Alvarez’s wife also claimed West Sacramento officers looked the other way when she sought help when her husband became violent. She called it a “brother code.”

McDonald, the new chief, insisted that the actions of one officer do not define his department. Still, policies he’s put in place since taking over will help ensure there is never “another Alvarez,” he said.

Sergeants are expected to be more involved in direct supervision of street cops — for instance, showing up to help during arrests. McDonald also requires a supervising officer on all shifts, including the overnight. He’s mandated that his officers use their audio-visual units and that cars get regularly serviced to ensure the units, along with the GPS systems, work. The city also has applied for a grant to purchase body cameras, which he hopes to have in place by year’s end.

McDonald said the changes were not a specific response to the Alvarez case, but rather part of an attempt to create an atmosphere in which officers quickly report any signs of misconduct.

“They need to understand that it’s an expectation that if they see something that’s inappropriate, they need to stand up,” he said.

In the end, that’s what stopped Alvarez. When a victim told West Sacramento patrol officer Jason Mahaffey in September 2012 that Alvarez coerced her into performing oral sex, he immediately went to his superiors. So did a police officer in adjacent Sacramento who heard similar accusations from a heroin addict who also ended up testifying in the criminal case.

The resulting investigation led to Alvarez’s convictions.

“There’s a hero in there somewhere,” McDonald said. “You just have to look for it.”

Bevard, however, still sees only a daughter whose vulnerable mental state has worsened since her encounters with Alvarez.

“She thinks she needs protecting from the police, when they’re supposed to be the ones protecting her,” said the mother, her voice faltering on the word “protecting.”

No apologies or settlements — even promises to fix the system — will mend her broken trust.

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.