CHICAGO (AP) — A federal appeals court has ruled that two Illinois counties holding immigrant detainees at local jails must terminate their contracts with federal immigration authorities starting Thursday. Kankakee and McHenry counties had filed a lawsuit challenging an Illinois aimed at ending immigration detention by Jan. 1 and lost. But they were allowed to delay on appeal. The 7th U.S. Circuit Court of Appeals says the counties didn’t make their case. Roughly 100 detainees are at the two jails. Ending the contracts is expected to take a few weeks. County officials have previously said they’d continue to appeal. Messages left Thursday for county leaders and federal immigration authorities weren’t returned.