(Reuters) - A federal judge on Wednesday approved the substance of a proposal by lawyers representing cities and counties suing drug companies over the U.S. opioid epidemic that would bring every state and municipality in the country into their settlement talks.

FILE PHOTO: Bottles of several opioid based medication at a pharmacy in Portsmouth, Ohio, June 21, 2017. REUTERS/Bryan Woolston/File Photo

U.S. District Judge Dan Polster, in Cleveland, Ohio, federal court, said that the plan, which was opposed by 37 states and the District of Columbia, “does not interfere with the states settling their own cases any way they want.”

“This process simply provides an option - and in the court’s opinion, it is a powerful, creative and helpful one,” the judge wrote.

The proposal, part of litigation consolidating about 2,000 lawsuits against opioid manufacturers, retailers and others seeking damages for the epidemic, calls for creating a class of up to 3,000 counties and 30,000 cities, towns and villages that could vote on whether to accept any settlement the plaintiffs reach with the defendants.

A settlement would need to win support of at least 75 percent of class members to be approved.

To address concerns from states, Polster ruled the process could not be used to negotiate on behalf of counties and municipalities against their own state governments in any disputes over allocating settlement funds.

The offices of the Texas and Ohio attorneys general, which argued for the states opposing the plan at a hearing last month, could not immediately be reached for comment.

Some of the companies being sued, including McKesson Corp, AmerisourceBergen Corp, Walgreen Co, Walmart Inc and others, also opposed the framework. Lawyers for the companies could not immediately be reached for comment.

Polster’s approval of the proposal came as Purdue Pharma LP, one of the defendants in the opioid litigation, neared a settlement with more than 2,000 cities, counties and other plaintiffs ahead of an expected bankruptcy filing.

Opioids were involved in 400,000 overdose deaths from 1999 to 2017, according to the U.S. Centers for Disease Control and Prevention.

Thousands of lawsuits by states and local governments have accused drugmakers like OxyContin maker Purdue Pharma of downplaying the risks of opioids in their marketing, and accuse drug distributors of failing to halt suspicious opioid orders.

Most of the localities’ lawsuits are before Polster, who has pushed for a settlement before trial. Plaintiffs have claimed it could cost about $480 billion to address the epidemic.

State attorneys general are pursuing their own cases in state courts as well investigations and settlement talks.