A federal judge has dismissed Ashley Judd's sexual harassment case against disgraced producer Harvey Weinstein. But the judge also said Judd can pursue her accusation that Weinstein tried to ruin her career after she rejected his advances.

The development comes as Weinstein faces a trial in New York later this year over five counts of rape and sexual assault. Dozens of women have accused Weinstein of rape and sexual misconduct that allegedly took place over decades.

In California's Central District, Judge Philip S. Gutierrez granted a motion from Weinstein's defense team to dismiss the harassment portion of Judd's lawsuit, agreeing that at the time of the alleged offense, the law cited in Judd's suit did not cover producers such as Weinstein.

Instead, Gutierrez said that Judd can continue with the portion of her lawsuit that accuses Weinstein of sabotaging her job chances for blockbuster projects such as Peter Jackson's Lord of the Rings films.

It's the second time Gutierrez has dismissed the harassment portion of the suit, having initially done so in September. Judd filed to restore the claim in October, after the California legislature amended the state's harassment law to specifically include directors and producers.

Judd argued that the amendment should apply retroactively to her case. But the judge ruled that lawmakers had "modified, rather than clarified" the 1999 law, making it inappropriate to apply its new standards retroactively.

Gutierrez took pains to say he "is not determining whether Plaintiff was sexually harassed in the colloquial sense of the term," only whether the incident fell under the scope of the statute her lawsuit cited.

According to Judd's lawsuit, she met with the former movie mogul in late 1996 or early 1997, when he invited her to a breakfast meeting at the Peninsula Hotel in Beverly Hills.

The actress was hoping the "evaluative" meeting would cement her chances of landing big film roles — but when she arrived at the hotel, her lawsuit states, Weinstein was waiting for her in a bathrobe. He then asked to give her a massage, and asked her to watch him take a shower.

In an attempt to leave the room, Judd says, she made a "mock bargain" with Weinstein, "suggesting that she would consider letting him touch her only if she won an Academy Award in one of his films."

Judd says the producer repeatedly reminded her of that "little deal" — and that he also badmouthed her to Jackson.

Despite "serious discussions to play a major role in the Lord of the Rings trilogy," court documents state, Judd wasn't cast in the film. Judd says she didn't learn of a possible reason until 2017, when Jackson said in an interview that Weinstein had told him Judd was "a nightmare to work with" who should be avoided "at all costs."

The judge said Judd had "adequately stated a claim for defamation, intentional interference with prospective economic advantage, and violation of the [Unfair Competition Law]," based on her allegation that Weinstein retaliated against her.

Copyright 2019 NPR. To see more, visit https://www.npr.org.