A California judge on Wednesday dismissed a sexual harassment lawsuit filed by Ashley Judd against movie mogul Harvey Weinstein. The actress was suing Weinstein after "Lord of the Rings" director Peter Jackson said he didn't cast her in his films when Weinstein called her a "nightmare" to work with after she turned him down when he propositioned her.

Judge Philip Gutierrez wrote in his ruling Judd's relationship as an actress with the film producer was not covered under the California statute Judd had sued under. Further, although the law was changed in 2018 to include producer/actress relationship, Gutierrez said it couldn't be applied retroactively. The judge said he wasn't determining whether Judd was sexually harassed by Weinstein "in the colloquial sense of the term."

Judd, one of the first women to come forward with claims about the once-powerful Weinstein, alleged that during a meeting to discuss future movie roles, Weinstein "appeared in his bathrobe, and, instead of discussing film roles, asked if he could give her a massage." After she refused, she said he asked her "to help pick out clothes and to watch him shower."

Get Breaking News Delivered to Your Inbox

Judd said she engaged in what she called a "mock bargain" with Weinstein and then fled the room. She said Weinstein continued to "lord that traumatic event" over her and would mention their "little deal."

About a year after the alleged incident, Judd said she was seriously considered for a role in the "Lord of the Ring" trilogy, which she didn't get. In 2017, Jackson said Weinstein told him she was a "nightmare" to work with and he should "avoid [her] at all costs."

Gutierrez said Judd could continue with a defamation lawsuit.

"We have said from the beginning that this claim was unjustified, and we are pleased that the court saw it as we did. We believe that we will ultimately prevail on her remaining claim," Weinstein's lawyer Phyllis Kupferstein said in a statement.

Weinstein has been charged in New York with two counts of predatory sexual assault, one count of criminal sexual act in the first degree and one count each of rape in the first and third degree. He has been accused of raping a woman he knew in a hotel room in March 2013 and forcibly performing oral sex on another woman in 2006 at his Manhattan apartment. He denies all allegations of nonconsensual sex.