NEW YORK (AP) — Prosecutors in New York City abandoned part of their sexual assault case against Harvey Weinstein on Thursday after evidence surfaced that a lead police detective coached a witness to keep quiet when she raised doubts about the veracity of one of the allegations.

Weinstein, 66, looked on as a judge agreed to dismiss the lone charge related to Lucia Evans, who helped spark the #MeToo movement a year ago when she told The New Yorker that the Hollywood mogul had forced her to perform oral sex in 2004 when she was a college student and fledgling actress.

Weinstein’s lawyer, Benjamin Brafman, unsuccessfully urged Judge James Burke to deep-six the whole case, telling him: “The integrity of these proceedings has been compromised.”

The bulk of the prosecution case remains intact, with Weinstein still facing five charges over allegations that he raped an unidentified woman in his Manhattan hotel room in 2013 and performed a forcible sex act on a different woman in 2006. A conviction on the most serious charges could put him in prison for the rest of his life.

Weinstein denies all allegations of nonconsensual sex.

The turn of events, which had been simmering for weeks in closed-door meetings and sealed court documents, enraged Evans’ lawyer, who took to the courthouse steps to blast Manhattan District Attorney Cyrus R. Vance Jr. for walking away from her client. Evans told the truth and never misled investigators, lawyer Carrie Goldberg said.

“Let me be clear: the decision to throw away my client’s sexual assault charges says nothing about Weinstein’s guilt or innocence. Nor does it reflect on Lucia’s consistent allegation that she was sexually assaulted with force by Harvey Weinstein,” Goldberg said outside the courthouse. “It only speaks volumes about the Manhattan DA’s office and its mishandling of my client’s case.”

Prosecutor Joan Illuzzi-Orbon insisted in court that the rest of the case is strong and said the district attorney’s office was looking into the possibility of bringing additional charges.

“In short, your honor, we are moving full steam ahead,” she said.

Det. Nicholas DiGaudio, who was one of two investigators who escorted Weinstein out of a police station and into court after his May arrest, is now embroiled in an internal police department investigation and has been thrown off the case. Chief of Detectives Dermot Shea said Thursday that the department takes seriously the allegations against him.

Prosecutors said in a letter unsealed after Thursday’s hearing that they learned weeks ago that a woman who was with Evans the night she first met Weinstein at a restaurant had given DiGaudio a contradictory account of what happened, but that the detective had urged her to keep quiet, telling her “less is more.”

The woman, prosecutors said, told the detective in February that Weinstein had offered them money to flash their breasts during the restaurant encounter. They initially declined, but the woman said that Evans later told her she had gone ahead and exposed herself to the film producer in a hallway. Goldberg disputed that.

The woman also told the detective that sometime after an office meeting where Evans alleged Weinstein forced her to perform oral sex, she suggested what happened was consensual, according to the letter. Weinstein had promised to get her an acting job if she agreed to perform oral sex, and she agreed, it said.

According to the witness, who was not named in the letter, Evans had been drinking and “appeared to be upset, embarrassed and shaking” when she recounted the story.

Prosecutors also disclosed that they had discovered a draft email that Evans had written three years ago to a man who is now her husband that “describes details of the sexual assault that differ from the account” she provided to investigators.

A message left on a phone DiGaudio used in the past wasn’t returned. The union for New York City police detectives didn’t return a message.

Brafman said he believed Evans had lied both to the grand jury and to The New Yorker about her encounter with Weinstein and suggested she be prosecuted for perjury.

“This is an attack on the fundamental integrity of the grand jury process,” Brafman said. “If you have a person willing to commit perjury in the grand jury, that is as serious as the crime of sexual assault because it undermines the fairness of the process for all of us.”

Goldberg said Evans told the grand jury the truth.

“The DA is aware of robust evidence, including witnesses, that seriously undermine the witness’ credibility and recollection of events. Yet, the DA consented to dismissal prior to investigating this evidence,” she wrote on Twitter.

The developments in Weinstein’s case on Thursday capped a tough six-day stretch for the #MeToo movement, bookended by Supreme Court Justice Brett Kavanaugh’s confirmation amid decades-old allegations that he had committed sexual misconduct. But victim advocates didn’t see it as a setback.

“This is so much larger than any singular case,” Kristen Houser of the National Sexual Violence Resource Center said. “Weinstein may have been the snowball that started the avalanche, but the ability of any one perpetrator being held accountable or getting away with it doesn’t alter the national outrage.”

The New Yorker, in a statement, said it stands by its reporting and fact-checking process and that “any assertion by lawyers for Harvey Weinstein that The New Yorker had information that contradicted Lucia Evans’s account is patently incorrect.”

Vance has already been fiercely criticized for declining to prosecute Weinstein when an Italian model accused him of grabbing her breasts in 2015. At the time, Vance cited a lack of supporting evidence, despite the existence of a clandestinely made recording of Weinstein discussing the episode with the woman.

In the months after The New York Times and The New Yorker began publishing stories about Weinstein’s interactions with women, activists pressured Vance to bring charges as dozens of people came forward with claims of sexual misconduct against him.

DiGaudio and other police officials poured on the pressure, saying publicly that they believed they had gathered ample evidence to make an arrest.

The Associated Press does not identify alleged victims of sexual assaults unless they come forward publicly, as Evans has done.

Weinstein is free on $1 million bail and is due back in court Dec. 20.

__

Follow Sisak at https://twitter.com/mikesisak and Hays at https://twitter.com/APtomhays