A federal judge has dismissed most of the claims in a sexual harassment lawsuit that actress Blake Lively filed against her It Ends with Us co-star Justin Baldoni.

Judge Lewis Liman threw out 10 of 13 allegations in Lively's case, including harassment and defamation.

He left in place three claims - breach of contract, retaliation, and aiding and abetting in retaliation - which will now go to a civil trial in New York on 18 May.

The Hollywood legal battle began in 2024 when Lively sued Baldoni, accusing him of harassment and a smear campaign on the set of their hit movie. He denied it and counter-sued.

A member of Lively's legal team, Sigrid McCawley, told the BBC the case has always been and will remain focused on the devastating retaliation and the extraordinary steps the defendants took to destroy the actress' reputation.

She noted that the sexual harassment claims were dropped, not because the defendants did nothing wrong, but because of a technicality.

Lively plans to testify during the trial, McCawley said, and would continue to shine a light on this vicious form of online retaliation.

In a statement, Baldoni's legal team said it was grateful to the Court for its careful review of the facts, law and voluminous evidence that was provided.

What's left is a significantly narrowed case, and we look forward to presenting our defense to the remaining claims in court, his attorneys said.

A judge last year dismissed Baldoni's $400m (£295m) counter-lawsuit against Lively, which alleged civil extortion, defamation and invasion of privacy.

The case stems from interactions between Baldoni and Lively on the set of It Ends With Us, an adaption of a best-selling Colleen Hoover novel.

The film features Lively as the main character, Lily Bloom, a young woman who grew up witnessing domestic abuse and finds herself in the same position years later.

Lively's legal team have accused Baldoni and his film studio, Wayfarer, of planning to wreck her reputation, including by social media manipulation and using friendly journalists to sow certain narratives.

She shared details of the allegations in a New York Times article published before her lawsuit.

Lively filed a lawsuit against Baldoni's Wayfarer Studios in December 2024, alleging he sexually harassed her on set and retaliated against her for bringing those complaints, among other allegations.

In his opinion, Judge Liman listed reasons for dismissing the many allegations against Baldoni, including jurisdictional issues related to California law since the filming occurred in New Jersey and Lively's status as an independent contractor.

Lively had accused Baldoni's lawyer, Bryan Freedman, of defaming her in a series of statements. However, those statements were found to be related to the allegations Baldoni faced and did not meet the necessary criteria for defamation.

Judge Liman noted that while much of Lively's complaints were not actionable, certain conduct by Baldoni and his team may have crossed the line, and he allowed some retaliation claims to move forward for trial.

Evidence in the legal battle has involved texts between Lively and Taylor Swift about Baldoni.