The pharmaceutical company Endo International on Thursday announced a $50 million settlement with the New York Attorney General’s Office and Suffolk and Nassau counties, removing another defendant from New York’s sprawling opioid trial, which began in June on Long Island.

Endo and its subsidiaries, including Endo Pharmaceuticals and Par Pharmaceuticals, will pay $22.3 million to the attorney general’s office and $13.85 million to each of the counties to resolve the suit, in which the government officials alleged that the companies were in part responsible for the opioid crisis.