LAFAYETTE, La. — The U.S. Justice Department said Monday it has reached agreements with two local governments in Louisiana to end "investigative holds" — a practice of unconstitutionally arresting and holding people wanted for questioning in criminal cases.

The announcement came weeks after the settlement of two class-action lawsuits filed on behalf of victims of the practice in the city of Ville Platte and in surrounding Evangeline Parish, about 80 miles (129 kilometers) west of Baton Rouge. Settlement terms weren't disclosed.

The Justice Department said in a 2016 report that the practice was used routinely for years and that hundreds were illegally arrested without probable cause. It said some people were strip-searched and detained for days.

"Both agencies acknowledged that they sometimes used holds to investigate criminal activity for as long as anyone at the agency can remember," the department's Monday news release said. "Because these 'investigative holds' were conducted without probable cause, they violated the Fourth Amendment's protection against unreasonable searches and seizures."

The city and the parish agreed to better train and supervise officers to make sure the practice doesn't resume. They also agreed to collect better data on arrests. Plaintiffs' lawyers in the class-action case had said the total number of arrests for investigative holds is likely underreported because the agencies use a "rudimentary" system for keeping arrest records

The Justice Department, which began investigating in April 2015, counted what it called a "staggering" number of investigative holds for such a sparsely populated community. Ville Platte police officers used the practice more than 700 times between 2012 and 2014; the sheriff's office made more than 200 such arrests over the same period.