Puerto Rico has reached an agreement with the U.S. government ending a 12-year legal battle to improve the island's health system for the mentally disabled.

Federal officials had accused the U.S. territory of abusing and neglecting hundreds of mentally disabled people by not providing food, medication, adequate housing, therapy or mental health care.

Justice Secretary Guillermo Somoza said Thursday that Puerto Rico has since agreed to make dozens of changes, including opening new treatment centers and hiring more employees, as a result of the more than 1,300 court orders issued during the lengthy litigation.

The U.S. Department of Justice had filed a civil rights lawsuit in April 1999 following a two-year investigation.