LOS ANGELES (AP) — A judge on Friday said “That ’70s Show” actor Danny Masterson must stand trial on three counts of rape after hearing days of dramatic and emotional testimony from three women who said he attacked them in 2001 and 2003.

Los Angeles County Superior Court Judge Charlaine F. Olmedo made the determination after the prosecution laid out its evidence over four days. She said she found the women’s testimony credible for the purposes of a preliminary hearing, where the bar for sufficient evidence is much lower than at trial.

The forthcoming trial will represent the rare prosecution of a Hollywood figure in the #MeToo era despite dozens of investigations by police and the Los Angeles district attorney, most of which have ended without charges.

Masterson denies the rape charges. His attorney, Thomas Mesereau, said Masterson had consensual sex with the women and that he would prove his client’s innocence.

The actor had no visible reaction to the judge’s decision to send him to trial as he sat in court, with a small group of family and friends behind him. Mesereau declined to comment outside court.

During the hearing, Mesereau repeatedly challenged the women on discrepancies in their stories in the years since they said they were raped and suggested that the prosecution was tainted by anti-religious bias against the Church of Scientology.

Masterson is a prominent Scientologist, all three women are former Scientologists and the church and its teachings came up constantly during testimony.

The judge said she found the women’s explanations credible that church teachings kept them from reporting their accusations to police for years.

Another defense attorney, Sharon Appelbaum, said the three women had colluded to form a “sisterhood” that “seems to want to take down Mr. Masterson and take down Scientology.”

Appelbaum said they had coordinated their stories over the years, making them increasingly similar, adding and subtracting details that didn’t fit and changing stories they previously told police.

Deputy District Attorney Reinhold Mueller said the testimony was “anything but” coordinated.

“These were not rehearsed statements,” Mueller said. “They were heartfelt, and they each had their versions of what happened. If there is any consistency in these statements, it was because the defendant was consistent in these acts.”

Defense attorneys also said a lawsuit filed by the women showed they were seeking financial gain. The prosecutor countered that the lawsuit was filed to stop the harassment they had been receiving from the church since coming forward. The church has denied all the allegations in the lawsuit.

The 45-year-old actor has been free on bail since his June arrest. He is charged with three counts of rape by force or fear and could get up to 45 years in prison if convicted. He was told to return for arraignment on June 7.

The allegations happened at the height of Masterson’s fame, when he starred as Steven Hyde on Fox TV’s retro sitcom “That ’70s Show” from 1998 to 2006 alongside Ashton Kutcher, Mila Kunis and Topher Grace.

He had reunited with Kutcher on the Netflix Western sitcom “The Ranch” when the LAPD investigation of him was revealed in March 2017. The news did not have immediate career repercussions for Masterson, but later in the year, after allegations against Harvey Weinstein shook Hollywood, he was written off the show.