The N.C. Supreme Court has agreed unanimously that illegal immigrants held in jail under an agreement between the county sheriff and the federal government cannot challenge their detention in state court.

The decision has no direct bearing on defendants Carlos Chavez and Luis Lopez, whom the Mecklenburg County sheriff turned over to federal immigration agents in 2017. But the case has proceeded through the courts to determine whether future defendants held under an agreement tied to the federal 287(g) program could file similar challenges.

In overturning part of an earlier ruling from the N.C. Court of Appeals, the state’s highest court says no. Justice Sam Ervin IV writes for the majority:

… [A] trial judge who has been presented with an application for the issuance of a writ of habeas corpus lacks the authority to make any determination concerning the validity of any immigration-related process upon which a custodian who has entered into a 287(g) agreement with the federal government claims to beholding the petitioner, including whether the petitioner is the person named in the immigration-related process, whether the process is facially valid, whether the personnel employed by the custodian are properly certified, or whether the process has sufficient factual support, since attempting to make such determinations would place the trial judge in the position of making decisions that have been reserved for federal, rather than state, judicial officials and potentially interfering with the manner in which federal immigration laws are administered. … As a result, in the event that a petitioner contends that he or she is being held unlawfully by a sheriff who is a party to a 287(g) agreement with the federal government on the basis of a defective immigration-related arrest warrant or detainer, his or her exclusive remedy lies with the federal, rather than the state, courts.