Walmart agreed to a $3.1 billion settlement as a part of lawsuits filed by state, local and tribal governments claiming the retailer failed to regulate opioid prescriptions, which allegedly contributed to an opioid crisis.

The company said the settlement framework is the best course of action for all parties, since the money can be used to aid local communities and governments in fighting against the crisis, according to a release.

The giant retailer added that it “strongly disputes the allegations in these matters, and this settlement framework does not include any admission of liability.”

Nearly 108,000 Americans died of drug overdoses in 2021, a nearly 15% increase from the previous record set in 2020, as Bridger Beal-Cvetko reported for the Deseret News.

New York Attorney General Letitia James, who co-led a coalition of attorneys general amid negotiations, said that Walmart will need to make “significant improvements” by complying with oversight measures, preventing fraudulent prescriptions and flagging suspicious ones.

“For decades, the opioid epidemic has ravaged communities here in New York and across the country,” said James, according to a press release. “Pharmacies such as Walmart played an undeniable role in perpetuating opioids’ destruction, and my fellow attorneys general and I are holding them accountable.”

Per The Guardian, the settlements will be paid off over the next year. Pharmacy chains like CVS Health and Walgreens have also agreed to pay $5 billion each, paid over the course of a decade.

The $3.1 million received from Walmart will be divided among those state, local and tribal governments willing to participate, according to The Hill. At least 43 states will need to support the lawsuit by the end of 2022 for it to be finalized.

This proposed settlement is the first nationwide deal with pharmacy companies after nationwide opioid settlements with drugmakers and distributors totaling more than $33 billion were rolled out, per Reuters.