Pharmacy operators CVS, Walmart and Walgreens must pay a combined $650.6 million to two Ohio counties to address the damage done by the opioid epidemic, a federal judge ruled on Wednesday.

The order by U.S. Judge Dan Polster in Cleveland comes after a jury last November concluded that the pharmacy chains helped create a public nuisance in Lake and Trumbull counties by over-supplying addictive pain pills, many of which found their way onto the black market. The pharmacies have said they would appeal that verdict.

Polster held a separate non-jury trial earlier this year to decide how much the companies had to pay.

"We are disappointed with this outcome," Walgreens spokesman Fraser Engleman said in a statement. "The facts and the law did not support the jury verdict last fall, and they do not support the court's decision now."

CVS and Walmart did not immediately respond to requests for comment.

Polster said the sum must be paid over 15 years, with the amount for the first two years, or $86.7 million, to be paid into a fund immediately. The judge also ordered the companies to implement new procedures to combat illegal diversion of opioid drugs.

The U.S. opioid epidemic has caused more than 500,000 overdose deaths over two decades, according to government data. More than 3,300 opioid lawsuits have been filed nationally against drugmakers, distributors and pharmacy chains.

The litigation has resulted in several nationwide settlements, including a $26 billion deal with Johnson & Johnson and the three leading distributors, a $2.37 billion settlement with AbbVie Inc and a $4.25 billion settlement with Teva Pharmaceutical Industries Ltd.

Pharmacies have yet to reach a nationwide settlement.