CVS, Walmart and Walgreens must pay $650 million to alleviate the opioid crisis in two Ohio counties, a judge has ruled.

Wednesday’s order, by U.S. District Judge Dan Polster of the Northern District of Ohio, provides an abatement program to Trumbull County and Lake County, which won a jury verdict on Nov. 23 that found all three pharmacies had created a public nuisance. Polster, who said he would appoint an administrator to oversee the funds, heard arguments from both sides earlier this year on how much the pharmacies should pay to the counties.