Walmart Inc. sued the federal government in hopes of pre-empting regulators’ claims the retailer added fuel to the U.S.’s opioid crisis by filling suspicious painkiller prescriptions across the country.

The world’s largest retailer argues the U.S. Justice Department and Drug Enforcement Administration is scapegoating the chain to divert attention from the agencies’ failures to effectively address the public-health crisis over opioids, according to the suit, filed Thursday in federal court in Texas.

Oversight groups have “meticulously catalogued” the ways regulators have “failed to safeguard the public from improper diversion of prescription opioids,” Walmart’s lawyers said in the 54-page complaint.

Spokespersons for the Justice Department and DEA didn’t immediately respond to messages seeking comment on the suit. It comes a day after federal prosecutors announced an US$8.3 billion deal with drugmaker Purdue Pharma LP under which the company will plead guilty to criminal charges over its marketing of its opioid-based OxyContin painkiller.

Walmart indicated in the suit that it decided to sue the government in anticipation of the DOJ filing its own suit alleging the chain mishandled the highly addictive pills. The company wants a judge to remove “unacceptable uncertainty” about its practices.

The Wall Street Journal reported earlier on the suit.

The case is Walmart Inc. v. U.S. Department of Justice, 20-CV-00817, U.S. District Court, Eastern District of Texas (Sherman).