An 11th-hour bid to delay a landmark federal opioid trial failed after a group of state attorneys general tried to persuade U.S. District Court Judge Dan Aaron Polster to give them more time to craft a settlement in their own cases, according to people with familiar with the events.

They told Polster they were trying to reach an $18 billion settlement with the nation’s three largest drug distributors, McKesson Corp., Cardinal Health and AmerisourceBergen, according to the people familiar with the events who spoke on the condition of anonymity because of the sensitivity of the negotiations.

The state attorneys general have filed their own lawsuits against the drug industry for saturating their states with highly addictive pain pills. Polster is overseeing more than 2,500 lawsuits against the industry filed by cities, counties and Native American tribes. Those suits have been consolidated into a massive federal case in a Cleveland courtroom, where jury selection is scheduled to begin Wednesday morning.

During a hearing Tuesday, Polster indicated that jury selection would proceed Wednesday as scheduled.

Lawyers representing the local communities said Tuesday night they are not part of the settlement talks with the distributors.

“These settlements do not impact the first trial scheduled for Monday,” said Paul T. Farrell Jr., co-lead attorney for the plaintiffs in the Cleveland case. “We’re going to trial.”

Johnson & Johnson also is in settlement talks with the state attorneys general, according to two people familiar with the talks.

A spokesman for AmerisourceBergen declined to comment Tuesday night. Representatives of Cardinal and McKesson did not immediately respond to requests for comment.

Johnson & Johnson said in a statement: “As previously stated, we remain open to viable options to resolve these cases, including through settlement.”

On Wednesday morning, attorneys for several companies asked Polster to postpone the trial, asserting that media coverage of the settlement talks had tainted the pool of potential jurors.

“This is not just a mention,” said Ashley W. Hardin, a Cardinal Health attorney, of the widespread media coverage. “This is a pervasive mention.”

Polster refused, saying potential jurors would be questioned closely and he would make sure no one was selected who had been biased by coverage.

The federal trial in Cleveland, slated to have opening arguments next Monday, is known as a “bellwether.” It involves just two Ohio counties, Cuyahoga and Summit, as a test case of how other lawsuits against the companies might fare in the future.

More than 400,000 people have died of opioid overdoses since 1999. The state attorneys general and the plaintiffs in the Cleveland case allege the companies failed to maintain effective controls over their narcotics and allowed pain pills to pour onto the black market. The companies said they followed the law and blame corrupt doctors, drug abusers, the Drug Enforcement Administration and others for the epidemic.

McKesson, Cardinal Health and AmerisourceBergen have been in talks with a bipartisan group of states through the National Association of Attorneys General, according to two people with knowledge of the talks, with one possible tally for the settlement being $18 billion, stretched out over 18 years. The Wall Street Journal first reported the settlement talks.

The amount of the settlement could go higher if Johnson & Johnson agrees to enter the deal, said the two people.

A conference call for attorneys general was planned for Tuesday night to decide on final terms that states could consider, they said.

The talks appeared to be on a smoother trajectory than those with Purdue Pharma, which divided attorneys general largely along party lines, with Republican-controlled states supporting a settlement and Democratic-controlled states opposing it, saying it did not go far enough.

With the federal trial looming, several companies have reached settlements with those plaintiffs.

Johnson & Johnson announced this month that it reached a $20.4 million settlement with the two Ohio counties for $10 million in cash, $5 million in legal fees and $5.4 million to nonprofits for opioid-related programs in those communities.

The Johnson & Johnson settlement came about three weeks after Ireland-based Mallinckrodt Pharmaceuticals, one of the largest manufacturers of generic opioids in the United States, announced a “settlement in principle” with the two counties.

Under that deal, Mallinckrodt would pay them $24 million in cash and donate $6 million in medications, including those for addiction treatment.

Purdue Pharma, the manufacturer of the powerful opioid OxyContin, which has been widely blamed for fueling the crisis, is working on a global settlement worth as much as $12 billion. The company has also filed for bankruptcy. Along with the plaintiffs in the federal case, attorneys general from across the country have also sued Purdue and its owners, the Sackler family.

News of the negotiations with the three distributors highlights the widening rift between the state attorneys general, who hold political office and have been pushing to settle, and the Cleveland case lawyers, who want to take the companies before juries and let them decide whether the companies should be held accountable and for how much.

The effort by state attorneys general is the latest of several efforts to delay the Cleveland trial.

In August, Ohio Attorney General Dave Yost and a dozen other attorneys general made an appeal to the 6th Circuit of Appeals, requesting a delay in the trial and saying state claims should be put ahead of the federal trial. The court rejected the request.

In September, the drug companies demanded that Polster recuse himself, questioning his impartiality in the case because he had urged both sides to settle so that money for drug treatment and other services could quickly go to communities hard hit by the epidemic.

Polster rejected the companies’ assertion that his comments showed a bias. In his ruling, he wrote that “publicly acknowledging” the toll of the opioid epidemic “does not suggest I am biased; it shows that I am human.”