The US Justice Department sued Walmart over its role in the opioid crisis on Tuesday, alleging the giant retailer wrongly filled prescriptions and worsened a public health disaster.

The suit accuses Walmart of irresponsible handling of orders, filling thousands of “invalid” prescriptions.

Authorities could seek up to billions of dollars in penalties, in the litigation that followed a multi-year investigation, the Justice Department said in a press release.

“As one of the largest pharmacy chains and wholesale drug distributors in the country, Walmart had the responsibility and the means to help prevent the diversion of prescription opioids,” said Jeffrey Bossert Clark, acting head of DOJ’s civil division.

“Instead, for years, it did the opposite, filling thousands of invalid prescriptions at its pharmacies and failing to report suspicious orders of opioids and other drugs placed by those pharmacies.”

Walmart did not immediately respond to a request for comment, but the company, the world’s biggest retailer, filed its own lawsuit against the Justice Department in October that argued that the US crackdown put it in a no-win position.

Pharmacists “must make a difficult decision” of either accepting a doctor’s “medical judgment and fill the opioid prescription, or second-guess the doctor’s judgment and refuse to fill it,” Walmart said in its suit.

“Either decision puts the pharmacist and pharmacy at great risk,” the company argued.

It said it faces potential federal action if prosecutors say an order was wrongly filled, or the chance of having a pharmacist license “stripped for the unauthorized practice of medicine, not to mention the potential harm to patients in need of their medicine.”