Blake Lively and Justin Baldoni, the costars of the 2024 film “It Ends With Us,” ended their legal battle with a settlement announced Monday, two weeks before jury selection was set to begin in a New York trial over allegations that Baldoni orchestrated a smear campaign after Lively accused him of sexual harassment on set. The agreement, whose terms were not disclosed, puts an end to dueling lawsuits that had threatened to expose the darker dynamics of Hollywood filmmaking and further damage the reputations of both actors.

The parties issued a joint statement through their lawyers that framed the resolution around domestic violence survivors — a cause central to the film itself, which is an adaptation of Colleen Hoover’s bestselling novel about a relationship that devolves into abuse. “Raising awareness, and making a meaningful impact in the lives of domestic violence survivors — and all survivors — is a goal that we stand behind,” Lively and Baldoni said. “It is our sincere hope that this brings closure and allows all involved to move forward constructively and in peace, including a respectful environment online.”

Lively, 38, sued Baldoni, 42, and his production company Wayfarer Studios at the end of 2024, claiming that Baldoni had retaliated against her after she privately complained of sexual harassment during filming. In court papers, she alleged that Baldoni made inappropriate comments about her appearance, violated physical boundaries while filming a love scene, and pushed for nudity during a childbirth scene against her wishes. Baldoni denied any wrongdoing, arguing that his conduct fell within the normal creative process of making a movie and accusing Lively of fabricating the complaints to seize creative control.

Months later, Baldoni countersued Lively, her husband — “Deadpool” star Ryan Reynolds — and their publicist for defamation and extortion, alleging that they manipulated his public image with the help of her famous friends. The competing claims set the stage for a trial that was to begin on May 18, with Lively’s retaliation claim as the central issue. That claim contended that Baldoni and the studio hired a “digital army” to post bogus negative content about Lively online and fed “manufactured content to unwitting reporters” in order to “batter her image, harm her businesses, and cause her family severe emotional harm.”

Before the settlement, U.S. District Judge Lewis J. Liman had trimmed significant portions of both sides’ cases. Last June, he dismissed Baldoni’s defamation and extortion lawsuit. In April, he threw out Lively’s sexual harassment claims, ruling that she could not pursue them under federal law because she was an independent contractor, not an employee, on the movie set. The remaining claims — including Lively’s retaliation allegation — were set for trial, but the settlement now moots them.

The joint statement acknowledged the difficult dynamics that had spilled into public view, saying the parties recognized that Lively’s concerns “deserved to be heard” and that they “remain firmly committed to workplaces free of improprieties and unproductive environments.” They also praised the film itself: “The end product — the movie ‘It Ends With Us’ — is a source of pride to all of us who worked to bring it to life.”

“It Ends With Us” was released in August 2024 and became a box office success despite criticism that it glamorized domestic violence. The very public feud between its stars, however, overshadowed the film’s message and dominated entertainment coverage for months. Baldoni, who directed the dark romantic drama and starred alongside Lively, is also the author of “Man Enough,” a book challenging traditional notions of masculinity. Lively rose to fame in the TV series “Gossip Girl” and has since appeared in films including “The Town” and “The Shallows.”