The operators of four nursing homes in New York will pay $45 million to settle claims that they neglected and mistreated residents, including some who were forced to sit in their own urine and feces for hours, state Attorney General Letitia James announced Thursday.

The Democrat filed a civil lawsuit last year that accused the owners and operators of Centers Health Care of using Medicaid and Medicare funds to enrich themselves, their relatives and associates instead of using funds for resident care. James claimed understaffing at the homes contributed to neglectful care. She said residents lived in squalor and were left unsupervised, leading to injuries.

Under the settlement, Centers and its owners will direct $35 million for improved resident care and staffing. Medicaid and Medicare programs will receive $8.75 million in restitution. Independent monitors for operations and finances were appointed by the court shortly after the lawsuit was filed and reforms have already begun, according to the attorney general.

“Centers’ owners operated the nursing homes with insufficient staffing so that they could pocket tens of millions of taxpayer dollars meant for resident care," James said in a prepared statement. “Residents suffered tragic harm and their families were often left in the dark or in despair about their loved ones.”

Centers, in a prepared statement, said it was pleased to resolve the litigation, “which dismisses all allegations of wrongdoing against Centers.”

“Over the last three decades, Centers has cared for thousands of residents across dozens of facilities, while maintaining the highest standards of care and resident welfare, the statement read. ”We are committed to fully implementing the settlement terms, including a significant investment in resident care.”