According to initial testimony, on Sept. 15, 2017, the two plainclothes detectives from Brooklyn South Narcotics arrested the 18-year-old woman for carrying a small amount of pot, then handcuffed her and led her to the back of a police van.

The woman, whom The New York Times has not identified because of the nature of the original charges, told prosecutors that a routine drive to a Brooklyn precinct became her worst nightmare as the detectives took turns sexually assaulting her. Details about the allegations, released just as the #MeToo movement was gaining traction, pushed legislators in Albany to pass a common-sense law making it a crime for police officers to have sex with people in custody.

The two men, who prosecutors said did not report the incident to their superiors, originally faced more than 40 charges that included kidnapping, rape and sexual assault.

But as the case progressed, details emerged that cast doubt about her testimony to investigators and a grand jury, including evidence from cellphones and security cameras that did not match her original statements. The woman had said the detectives drove along the Belt Parkway, the Verrazzano-Narrows Bridge and past a location she said knew by heart, her grandmother’s home in Bay Ridge.

The cellphone records showed they never left Coney Island.

Advocates for victims of sexual assault have said it is not uncommon for rape victims to make inconsistent statements because of shame or trauma after an attack.

But other details muddied her story as well, including what she was wearing that night — sweatpants, not the miniskirt that she had said helped to facilitate the attack — and her description of the van, which had bucket seats, not the bench seats she had described.

In light of the new revelations, the district attorney dropped the most severe charges in March.

Earlier this year, prosecutors released a letter acknowledging that the woman had made “a series of false, misleading and inconsistent statements about the facts of this case and about collateral or unrelated matters” and that “she made some false statements under oath.”