WORTHINGTON (AP) -- The Minnesota Court of Appeals says the Nobles County Sheriff's Office can't keep jail inmates in custody for immigration officials after those inmates are eligible for release in state cases.

Monday's ruling comes in a class-action lawsuit filed by the American Civil Liberties Union of Minnesota.

The ACLU argued that the sheriff's office routinely violated the rights of jail inmates by transferring them from local to federal custody at the request of U.S. Immigration and Customs Enforcement.

An attorney for Nobles County says the decision isn't what the county wanted but provides guidance on how to deal with similar situations going forward.

ICE ``detainers'' request that local officials hold individuals in jail until federal officers pick them up. Some counties, including Hennepin County, have stopped honoring such requests.