Genesis Healthcare will pay $52.7 million under an “agreement in principle” to settle four separate U.S. Department of Justice investigations, the nation’s largest long-term care company said.

The settlement will resolve allegations over inadequate staffing numbers at several of the provider’s long-term care facilities from 2005 through 2013, along with allegations of billing fraud for hospice services, according to a statement released by the company. The settlement covers alleged Medicare rule violations for physical therapy at two subsidiaries owned by Genesis.

“The company has agreed to the settlement in principle in order to resolve the allegations underlying these successor matters and to avoid the uncertainty and expense of litigation,” the company’s statement said.

Genesis said it has already set aside $39.1 million for the settlement, but it expects to record an additional loss contingency expense of $13.6 million in the second quarter of 2016 as a result of the lawsuits. They added that they plan to pay the full amount over a period of five years.

The provider currently operates nursing homes in 34 states and employs nearly 90,000 workers nationwide.