New York’s highest court on Thursday overturned the 2020 sex crimes conviction of former Hollywood producer Harvey Weinstein, in the case that helped to create the #MeToo movement.

In a 4-3 decision, the state Court of Appeals said the trial judge made a critical mistake by letting prosecutors introduce testimony from women who claimed that Weinstein assaulted them, even though they were not part of the charges he faced.

The court also said the trial judge compounded the error by letting Weinstein be cross-examined in a way that portrayed him in a “highly prejudicial” light.

“It is an abuse of judicial discretion to permit untested allegations of nothing more than bad behavior that destroys a defendant’s character but sheds no light on their credibility as related to the criminal charges,” Judge Jenny Rivera wrote for the majority.

“The remedy for these egregious errors is a new trial,” she added.

A dissenting judge, Madeline Singas, said the outcome “perpetuates outdated notions of sexual violence and allows predators to escape accountability.”

Weinstein72, has been serving a 23-year prison sentence, after being convicted in February 2020 of sexually assaulting a former production assistant in 2006, and raping an aspiring actress in 2013.

It will be up to Manhattan District Attorney Alvin Bragg, whose predecessor Cyrus Vance brought the case, to decide how to proceed.

“We will do everything in our power to retry this case, and remain steadfast in our commitment to survivors of sexual assault,” Emily Tuttle, a spokesperson for Bragg, said in an email.

Bragg’s office is separately in the middle of a criminal hush money trial against former U.S. President Donald Trump.

A lawyer for Weinstein did not immediately respond to a request for comment.

It was not immediately clear how the decision would affect Weinstein, who has been serving his sentence in upstate New York.

Even if he were not retried, he still faces a separate 16-year prison sentence in California after being convicted there last year for the 2013 rape of an actress in Los Angeles.

Weinstein‘s original conviction was considered a milestone for #MeToo, in which women have accused hundreds of men in entertainment, media, politics and other fields of sexual misconduct.

“Today’s decision is a major step back in holding those accountable for acts of sexual violence,” said Douglas Wigdor, a lawyer who represented eight of Weinstein‘s accusers. “It will require the victims to endure yet another trial.”

Weinstein co-founded the Miramax film studio, whose hit movies included “Shakespeare in Love” and “Pulp Fiction.” His own eponymous film studio filed for bankruptcy in March 2018.