Johnson & Johnson agreed in the middle of a trial to pay more than $2 million to resolve a woman’s claims that asbestos-laced baby powder caused her cancer, according to people familiar with the case. The settlement marks a rare decision by the drugmaker to cut a deal while fighting thousands of similar claims.

Jurors in state court in Oakland, California, heard more than two weeks of testimony before the judge told them Monday that the case had settled. While the terms weren’t made public, people familiar with the accord said plaintiff Linda O’Hagan and her family agreed to J&J’s offer. The people asked not to be identified because they weren’t authorized to comment publicly about the accord.

J&J scored a big win last month in a talc case in St. Louis, where it had been hit with a $4.7 billion verdict in 2018 on behalf of more than 20 women blaming their cancers on its baby powder. In the December trial, jurors rejected a woman’s claim her ovarian cancer was tied to use of J&J’s talc-based powder.

“In litigation of every nature there are one-off situations where settlement is a reasonable alternative,” Kim Montagnino, a J&J spokeswoman, said in an emailed statement. “The decision to resolve any particular case in no way changes our overall position that our talc is safe, is asbestos free and does not cause cancer.”

The company, which faces almost 17,000 suits accusing it of hiding that its baby powder was contaminated with asbestos, has been on a roll at trial, racking up eight defense verdicts last year while losing five.

While it’s unusual for J&J to settle a case mid-trial, it has resolved some talc cases just before a trial started or while proceedings were in progress. The company hasn’t set up any organized settlement program, opting instead to contest claims at trial.

O’Hagan was diagnosed with mesothelioma — a cancer specifically linked to asbestos exposure — in August 2018 and underwent treatment for the disease, but probably had less than two years to live, her lawyers told jurors in opening arguments.

The 61-year-old is a native of Ireland who moved to the U.S. in 1991. Evidence in the case indicated she’d used baby powder for decades.

Another defendant in the case, a unit of London-based Rio Tinto Minerals, also settled during the trial for an undisclosed sum. O’Hagan alleged the company mined the talc that was used in J&J’s baby powder and knew it was tainted with asbestos.

Also Monday, a state judge in California’s Solano County threw out a woman’s claims that contaminated baby powder caused her cancer after finding she didn’t have evidence showing the talc she used was specifically laced with asbestos. “The mere inference that a talc product might contain asbestos does not create a triable issue,” Judge Wendy Getty concluded.

The case is O’Hagan v. Cyrus Mines Corp., RG-19019699, California Superior Court, Alameda County (Oakland).