(Gray News) - Walmart has agreed to pay $50 million to the federal government to resolve allegations that its pharmacies across the country illegally filled thousands of invalid prescriptions for opioids and other controlled substances, in violation of the Controlled Substances Act.

The settlement, announced by the U.S. Justice Department and the Drug Enforcement Administration (DEA), caps a years-long civil case that accused Walmart of ignoring glaring red flags about dangerous prescriptions while prioritizing sales and patient volume.

The company has not admitted liability, and the government's claims remain allegations.