INDIANAPOLIS (AP) — A federal appeals court is tossing out an agreement under which the sheriff's department in Indianapolis stopped detaining people based solely on U.S. Immigration and Customs Enforcement requests.

The ruling from the Chicago-based appeals court released Thursday comes after the Indiana attorney general's office argued a federal judge in Indianapolis improperly approved the 2017 agreement settling a lawsuit against the Marion County Sheriff's Department. The lawsuit claimed a man was wrongly jailed after an ICE detention request made without an arrest warrant.

Republican Attorney General Curtis Hill says the ruling upholds state law requiring police agencies to cooperate with federal immigration authorities.

The American Civil Liberties Union of Indiana filed the original lawsuit and says it is evaluating its legal options.