Transvaginal mesh device manufacturer Endo International PLC has agreed to pay $830 million to settle thousands of lawsuits alleging that its devices caused pain and bleeding in women.

The agreement in principle, announced on Wednesday, resolves “a substantial majority” of the transvaginal mesh claims against its Minneapolis subsidiary, American Medical Systems Inc. (AMS). The company estimated the settlement would resolve 20,000 claims, although it was unclear whether that is the number of lawsuits filed.