Johnson & Johnson announced it has reached a $20.4 million settlement with two Ohio counties ahead of a huge federal trial to determine responsibility for the opioid crisis, The Washington Post reports.

Under the terms of the settlement, Johnson & Johnson will pay the counties $10 million in cash. The company will also reimburse them for $5 million in legal fees and direct $5.4 million to nonprofits for opioid-related programs in the two counties.

Six defendants are scheduled to stand trial in a lawsuit brought by more than 2,500 cities, counties and Native American tribes. They include the three largest drug distributors in the country; Walgreens; Teva Pharmaceuticals; and a small Ohio-based drug distributor.

The cases have been consolidated before a federal judge in Cleveland. Jury selection is scheduled to start on October 16.