Open this photo in gallery:

Blake Lively leaves a courthouse in New York on Feb. 11.Seth Wenig/The Associated Press

A federal judge on Thursday dismissed actor Blake Lively’s sexual harassment claims in her lawsuit against actor and director Justin Baldoni, significantly narrowing her case over the filming of their 2024 romantic drama It Ends With Us.

U.S. District Judge Lewis Liman’s 152-page decision followed more than a year of acrimonious litigation over the movie, in which Lively and Baldoni co-starred and which Baldoni directed.

During a January court hearing, Lively’s lawyer Esra Hudson had argued that Baldoni repeatedly went too far, including by deviating from the script by adding unnecessary sexual content.

Hudson alleged this included a dance sequence in which Baldoni “nuzzled” Lively without consent, and a scene when Lively’s character was giving birth and she was pressured to wear little clothing and simulate nudity.

Liman wrote that Baldoni’s alleged conduct appeared to be directed toward Lively’s character in the scene, rather than Lively herself.

“Creative artists, no less than comedy room writers, must have some amount of space to experiment within the bounds of an agreed script without fear of being held liable for sexual harassment,” the judge wrote.

Liman said Lively can still try to convince jurors that Baldoni’s production company Wayfarer Studios retaliated against her after she complained about misconduct on the movie set. The judge said jurors could consider whether the defendants “impermissibly and materially altered” Lively’s career prospects, through what she called a smear campaign after Baldoni hired public relations and crisis management specialists.

“Certain conduct at least arguably crossed the line,” Liman said.

The case is scheduled to go to trial on May 18.

Taylor Swift can be deposed, but has no role in Lively-Baldoni litigation, lawyer says

Liman’s decision means jurors will not decide if Lively was sexually harassed, though some of her accusations of mistreatment could surface as she pursues her retaliation claim.

Lively “looks forward to testifying,” and showing the efforts made to destroy her reputation “because she stood up for safety on the set,” Sigrid McCawley, one of her lawyers, said in a statement. Baldoni’s lawyers said they were pleased with the dismissal of the sexual harassment claims, and all claims against the five individual defendants, including Wayfarer Chief Executive Jamey Heath. The defendants have strongly denied wrongdoing. “What’s left is a significantly narrowed case, and we look forward to presenting our defence,” defence lawyers Alexandra Shapiro and Jonathan Bach said in a joint statement.

Lively’s case has been closely followed in Hollywood.

It has drawn in famous people like singer Taylor Swift, model Gigi Hadid and actor Hugh Jackman, all of whom, according to Lively, might have information supporting her claims.

Lively, 38, sued Baldoni, Wayfarer and others in December 2024, seeking damages for alleged harassment, defamation, invasion of privacy and violations of federal and state civil rights laws.

She complained that the defendants created a sexually charged atmosphere during the movie’s production, then schemed to silence her and others from speaking out about the hostile environment they created.

Baldoni, 42, countered that he resolved Lively’s concerns as soon as she raised them, and that he was entitled to hire a crisis management firm after Lively began disparaging him publicly.

Judge dismisses Justin Baldoni’s $400-million defamation suit against Blake Lively

In dismissing the sexual harassment claims, Liman said there would have been enough evidence for jurors to consider whether Lively’s beliefs had been sincere, including being uncomfortable because of comments over her physical appearance.

But he said Lively could not pursue those claims under a federal civil rights law because she was an independent contractor, not an employee. He also said Lively had sued under a California law but the alleged wrongful conduct took place elsewhere.

The dispute became public in December 2024 when Lively filed a complaint against Baldoni with the California Civil Rights Department, followed by her lawsuit. A related article published in the New York Times was titled: “We Can Bury Anyone’: Inside a Hollywood Smear Machine. Baldoni sued Lively and her husband, actor Ryan Reynolds, for defamation, saying they tried to destroy his reputation, but Liman dismissed that case in June. The judge also dismissed Baldoni’s defamation case against the Times.

It Ends With Us starred Lively as a flower shop owner who marries a neurosurgeon played by Baldoni.

His character becomes abusive, reminding Lively’s character of her parents’ relationship, and the marriage falls apart after Lively’s character reconnects with her first love, who became a chef and restaurant owner.

Despite mixed reviews, the movie grossed more than US$351-million worldwide, according to Box Office Mojo.