A federal judge in Los Angeles has dismissed actress Ashley Judd's sexual harassment claim against movie producer Harvey Weinstein, but said she could proceed with a defamation claim against him.

Ms Judd had accused Mr Weinstein of defaming her in 1998 after she refused what she said were his sexual advances a year earlier.

In her lawsuit, filed in April 2018, the "Double Jeopardy" actress accused Mr Weinstein of smearing her reputation by discouraging director Peter Jackson from casting her in his blockbuster movie franchise "The Lord of the Rings."

Ms Judd, one of the first women in October 2017 to publicly accuse Mr Weinstein of sexual misconduct, had accused the Hollywood movie mogul of sexual harassment in violation of a California law barring such conduct by a person in a "business, service or professional relationship" with another.

In a footnote to his ruling, US District Judge Philip Gutierrez said he was not determining whether Ms Judd was sexually harassed by Mr Weinstein "in the colloquial sense of the term."

But Judge Gutierrez said that Ms Judd's relationship as an actress with the film producer was not covered under the California statute she had sued under, nor under a 2019 amendment.

"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 claims," Mr Weinstein's lawyer, Phyllis Kupferstein, said in a statement.

But Ms Judd's attorney, Theodore J. Boutrous, Jr, said that this ruling does not upend Judd's complaint.

"Nothing about today’s ruling changes that Ms Judd’s case is moving forward on multiple claims," Mr Boutrous said in a statement.

"We look forward to pursuing the three claims for relief that the Court has already ruled can move forward," he also said.

Mr Weinstein is to stand trial in May in New York on five charges, including rape, involving two other women.

The disgraced Hollywood producer of movies like "Shakespeare in Love" has been accused of sexual misconduct by more than 70 women.

He has denied the accusations, saying any sexual encounters were consensual.

Ms Judd's lawsuit had alleged Mr Weinstein "cornered her in a hotel room in 1997 under the guise of discussing business."

When she refused his demands, he retaliated by making what she called "baseless smears" against her to "Lord of the Rings" director Jackson, and she lost a part in the movie.

Mr Weinstein denied defaming Ms Judd or interfering with her career.