Johnson & Johnson, facing potentially costly litigation over opioids and baby powder, has agreed to pay $117 million to settle claims brought by dozens of states that said it deceptively marketed transvaginal pelvic mesh implants.

The settlement with attorneys general from 41 states and the District of Columbia was announced Thursday.

Pelvic mesh products have been at the heart of roughly $8 billion in personal-injury settlements between several manufacturers and tens of thousands of women in the United States.

This year, the Food and Drug Administration, after years of complaints, stopped the sale of pelvic mesh to treat a condition called organ prolapse. Johnson & Johnson had stopped selling pelvic mesh to treat that condition in 2012, but it and other manufacturers still sell similar products to treat urinary incontinence in women.