A federal judge in St. Paul has sternly rebuked the U.S. Justice Department over its handling of a yearslong Freedom of Information Act (FOIA) request filed by a Minneapolis attorney who is researching the sale and marketing of oxycodone, a widely prescribed and highly addictive painkiller.

In an opinion issued Wednesday, Senior U.S. District Judge Paul Magnuson ordered the government to negotiate with attorney Chris Madel over the release of data withheld from FOIA requests that Madel filed in 2012 and 2013.

Attorneys for the Justice Department and Drug Enforcement Administration, Magnuson wrote, "have lost their credibility" with the judge for refusing to negotiate and for publishing data online that they previously argued was too sensitive to ever share with Madel.

"The Court has given Defendants the benefit of the doubt throughout this litigation and Defendants have time and again failed to establish that they deserve that benefit," Magnuson wrote in a nine-page opinion.

Madel requested data on the distribution of oxycodone in Georgia by five entities including big pharmacy chains such as CVS Caremark and Walgreen Company. Madel explained in a declaration that he wanted to serve as a resource for authorities to help counter an ongoing opioid problem affecting much of the nation, "and the Southeast United States in particular."

Madel's FOIA requests sought the identity of each person or pharmacy to whom health care companies had distributed oxycodone and the quantity distributed. He also sought reports from a DEA database that tracks the flow of controlled substances. The attorney, who works for Robins Kaplan in Minneapolis, said he does not represent any drug companies and would be willing to submit to a court order prohibiting sharing the data with anyone other than law enforcement authorities.

In justifying its refusal to release records, the government has relied "almost solely" on broad objections by the health companies subject to the request, Magnuson wrote on Wednesday. Those companies so far failed to show that releasing any part of the data would create "competitive harm," he said, and government attorneys have repeated the same "overly general responses" to Madel's requests that appellate judges have since taken issue with.

In his order, Magnuson said attorneys for the agency have so far "refused to engage in serious discussions" to find a possible solution to the dispute.

But a Justice spokesman on Thursday said "we have engaged in extensive good faith negotiations with the plaintiff in this matter. We expect those negotiations to continue moving forward."

The DEA produced some records two months after Madel sued but omitted a report listing quarterly retail drug distributions by ZIP code, and specific sales records for four of the five entities requested. CVS was not doing business in Georgia at the time of the requests, the government said.

Attorneys argued that the omitted data contained information that could be used "to determine the companies' market shares, inventory levels, and sales trends in particular areas." Magnuson sided with the government in April 2014 and later denied a request for attorneys fees by Madel, who then appealed the judgments.

The Eighth Circuit Court of Appeals sent the case back to the district court because it said the government had not shown "with reasonable specificity" why it could not separate data that is exempted from the FOIA law from nonexempt records being withheld from Madel.

An attempt to compromise by limiting the scope of Madel's request was still opposed by the government. Meanwhile, the DEA also published last year a report it previously withheld from Madel, just months after attorneys argued against its release in court.

Magnuson asked the government last month to provide under seal a single page from one spreadsheet to be examined, but attorneys instead filed a "filtered" excerpt from several spreadsheets; Madel argued that spreadsheet rebutted their own claim that it was "not possible or practical" to search for and remove sensitive data before publishing.

On Wednesday, Magnuson ordered the disclosure of redacted spreadsheets unless both side can negotiate a release of such data.

The judge said a buyer's county, business activity, drug type, transaction date, dosage units and total grams for the years Madel requested would not be exempt under FOIA and could reasonably be separated from exempt information in the spreadsheets.

Madel's attorney, Jenny Robbins, said her client "is really happy with the order," and added that "we are hoping the government will start negotiating with us."

Stephen Montemayor • 612-673-1755

Twitter: @smontemayor