CVS Health has agreed to pay $450,000 to the federal government to settle allegations that several of its Rhode Island retail pharmacies filled forged and invalid painkiller prescriptions.

The agreement announced Monday is the culmination a two-year investigation by U.S. Attorney Peter Neronha's office and the Drug Enforcement Administration's Office of Diversion Control into several of the Woonsocket, Rhode Island-based CVS's retail pharmacy locations.

The DEA's Diversion Control offices routinely review pharmacies across the country looking for violations of the Controlled Substances Act, said Jim Martin, a spokesman for the U.S. Attorney's office in Providence.

CVS has denied wrongdoing.

In October 2013, authorities began investigating individuals in Rhode Island who were prescribing various controlled substances without the authority to do so, such as nurse practitioners.

Federal investigators said they found that some CVS locations were filling forged prescriptions with invalid prescriber DEA numbers or that the pharmacist filling the prescription knew or had reason to know the prescriptions were invalid or unauthorized.

They also said they found that some locations filled prescriptions for the opioid painkiller hydrocodone written by psychiatric nurse practitioners who are not authorized under Rhode Island state law to write such prescriptions. Under the Controlled Substance Act, such painkillers can only be prescribed by a physician.

Additionally, federal investigators said they found that CVS did not keep adequate records of prescriptions.

A message left for Elizabeth Ferguson, senior vice president and assistant general counsel for CVS, was not immediately returned.

The Department of Justice has a five-year statute of limitations for investigations into civil violations of the Controlled Substances Act. Authorities investigated the conduct beginning in March 2010.

Martin, of the U.S. Attorney's office, said he would not comment on whether individual pharmacists or prescribers are also being investigated.

Neronha in a statement Monday said the diversion and misuse of prescription painkillers is a public health crisis in Rhode Island.

"This crisis demands that all citizens — individual and corporate — act responsibly when it comes to the dispensing of controlled substances," Neronha said.

The DOJ has a mandate to attempt to resolve civil claims before filing a lawsuit. The DOJ often investigates pharmacies following an investigation into prescribers.