Johnson & Johnson agreement was with two Ohio counties ravaged by the opioid crisis

US healthcare giant Johnson & Johnson on Tuesday announced it had reached a $20.4 million settlement to avoid a much-anticipated trial in Ohio for allegedly fueling the opioid addiction crisis.

Several drugmakers have agreed deals ahead of the trial, due to open this month, which is seen as a national test case for many billions of dollars in settlements.

Millions of Americans sunk into addiction after using potent opioid painkillers that companies churned out and doctors freely prescribed over the past two decades.

The Johnson & Johnson agreement was with two Ohio counties ravaged by the opioid crisis -- Cuyahoga and Summit.

The settlement "resolves all of the counties' claims with no admission of liability and removes the company from the federal trial," Johnson & Johnson said in a statement.

The company added it wanted to avoid the "uncertainty of a trial" and said it continues "to seek meaningful progress in addressing the nation's opioid crisis."

In August, an Oklahoma judge ordered Johnson & Johnson to pay $572 million in damages for its role in fostering opioid addiction.

The company was accused of aggressive promotion of prescription painkillers and downplaying or hiding risk of addiction.

The US opioid epidemic has caused hundreds of thousands of overdose deaths.

Thousands of lawsuits have been lodged by states, cities, towns and Native American tribes seeking money to pay for overwhelmed health and social systems, families unable to care for themselves, and babies born addicted to the drugs.