Anna Chambers says two on-duty NYPD cops raped her while she was in custody; their lawyer says it was consensual.

State lawmakers in New York passed a bill Thursday to prohibit cops from having sex with people in custody, closing a legal loophole that has let police avoid sexual assault convictions by claiming sex with detainees was consensual. The bill was introduced in response to allegations that two on-duty New York City Police Department officers raped a handcuffed woman in their police van in September.

In February, BuzzFeed News reported that New York was one of 35 states that do not explicitly deem encounters between cops and those in their custody as sexual assault. In the weeks since, legislators in at least six states have introduced or begun drafting bills to change these statutes.

Of at least 158 law enforcement officers nationwide charged since 2006 with sexual assault, sexual battery, or unlawful sexual contact with somebody under their control, at least 26 have been acquitted or had charges dropped after claiming the encounters were consensual, according to a BuzzFeed News review of a Buffalo News database. The bill passed Thursday states that someone in police custody lacks the ability to consent to sex with an officer.

The loophole in New York law first drew public attention after an 18-year-old woman, who uses the pseudonym Anna Chambers, reported she was sexually assaulted by two detectives who'd detained her after finding weed and loose pills in the car she was in. DNA from a rape kit matched narcotics detectives Eddie Martins and Richard Hall. Both have pleaded not guilty to rape and other charges and are awaiting trial.

"Hopefully this is a start that will help public awareness and begin changing that police culture of sexual misconduct," Chambers told BuzzFeed News on Friday.

While the men have yet to give their accounts of the incident, Martins’ lawyer, Mark Bederow, summed up their defense by claiming, “There was no nonconsensual sexual encounter.”

