The nation’s largest skilled nursing pharmacy provider has agreed to pay $28 million to settle allegations that it received kickbacks to promote use of an anti-seizure medication to nursing home residents, the U.S. Department of Justice announced Monday.

Omnicare allegedly received kickbacks disguised as grants from pharmaceutical company Abbott Laboratories in exchange for recommending doctors to prescribe the drug Depakote to nursing home residents. The kickbacks, reportedly referred to in internal documents as the “one extra script per patient” program, allegedly caused a spike in Depakote claims to Medicare and Medicaid.

“Every day, elderly nursing home residents suffering from dementia rely on the independent judgment of our nation’s healthcare professionals for their personal care and their medical treatment,” Principal Deputy Assistant Attorney General Benjamin C. Mizer, said in the announcement. “Kickbacks to entities making drug recommendations compromise their independence and undermine their role in protecting nursing home residents from the use of unnecessary drugs.”

The DOJ reached a $1.5 billion settlement with Abbott in the case in 2012; long-term care pharmacy Pharmerica resolved similar kickback allegations involving Depakote for $9.25 million last October.

Omnicare was acquired by CVS for $10.4 billion in May 2015. While all of the allegations occurred before CVS purchased the long-term care pharmacy giant, the company “agreed to settle the case to avoid the expense and uncertainty that comes with a lengthy legal battle,” a CVS spokesman told the Associated Press.

Roughly $20.3 million of the settlement will go to the United States, while $7.8 has been designated to cover Medicaid claims by states that choose to participate in the federal settlement, authorities said.