NEWARK, N.J. — A Pennsylvania company that provides hospice services has agreed to pay $2 million to resolve allegations that it billed Medicare for medically unnecessary services.

Federal prosecutors in New Jersey announced the settlement Thursday with Bensalem-based Compassionate Care of Gwynedd Inc. The company did not admit any liability.

Prosecutors say that the company admitted patients who didn’t need hospice care for nearly seven years starting in 2005.

The Parsippany, New Jersey-based Compassionate Care Hospice Group said that it had no comment.

A group of whistleblowers will receive more than $350,000 of the settlement.