The drug manufacturer Allergan Finance announced a settlement with New York state and Nassau and Suffolk counties Wednesday, hours before it was set to offer its closing argument in New York’s multidefendant civil opioid trial in Suffolk County.

Allergan will pay up to $200 million if certain conditions are met, New York State Attorney General Letitia James announced.