A federal judge has ruled that state and local governments cannot publicize federal government data about where prescription opioids were distributed — a blow to news organizations seeking to report more deeply on the nation’s overdose and addiction crisis.

The U.S. Drug Enforcement Administration is providing the information to state and local governments to use in their lawsuits against companies that make, distribute and sell the drugs. Sharing the data even with them came with a long list of conditions, including that it could be used only for law enforcement and litigation.

Cleveland-based Judge Dan Polster, who is overseeing more than 800 of the lawsuits in federal court, ruled Thursday that the data cannot be made public, saying that doing so would reveal trade secrets and “eviscerate” the terms under which the information was shared.

The federal government collects information on the distribution of all controlled dangerous substances.

Polster has scheduled the first trials in the matter to start in March 2019. He’s been pushing in the meantime for a national settlement. The drug industry and government entities — including states that have not filed lawsuits — have been negotiating for months even as the cases are prepared for trial.

News organizations, including The Associated Press, had asked for the data through public records requests made to local governments.

A West Virginia judge made some of the data public in 2016. The Charleston (W.Va.) Gazette-Mail used it to report that 780 million pills flowed into the state of just 1.8 million residents over a six-year period. During that time, more than 1,700 West Virginians died from overdoses of opioids, a category of drugs that includes prescription opioids such as OxyContin and Vicodin, and illegal ones such as heroin and illicitly made fentanyl.

HD Media, owner of The Gazette-Mail, and The Washington Post argued in legal filings that disclosing the information might embarrass companies or government agencies, but that it would provide public accountability on behalf of people harmed by opioids.

Paul Farrell, a lead lawyer for local governments suing over the drugs, said the data would also show the public which pharmacies sold huge amounts of the drugs.

Combined, opioids killed more than 42,000 Americans in 2016, according to the U.S. Centers for Disease Control and Prevention.