Walmart settled a federal lawsuit with the U.S. Department of Justice regarding the nationwide opioid epidemic.

The 2020 lawsuit alleged Walmart pharmacies violated the federal Controlled Substances Act. Federal prosecutors claimed the retailer unlawfully dispensed controlled substances.

Financial terms of the agreement were not immediately disclosed. This settlement is separate from a 2022 deal to pay $3.1 billion to state and local governments.

The resolution removes a significant legal overhang for the retail giant.