The full U.S. Court of Appeals for the Fifth Circuit ruled Friday that the Constitution does not entitle immigrants who were never admitted to the United States to bond hearings while they are detained, upholding the Trump administration's mandatory detention policy in a 10-7 decision.

Writing for the majority in the court's opinion, Judge Cory T. Wilson said the three men who brought the consolidated cases have Fifth Amendment rights but, because they have never been admitted, are owed no procedures beyond the ones Congress spelled out in immigration law. Detainees who want their freedom, he wrote, can obtain it "at any moment by agreeing to leave the country." The length of the men's detention presented no constitutional problem that would justify habeas relief, the court concluded, and it reversed the district court decisions that had ruled in their favor.

Eight judges joined Wilson's opinion, among them the chief judge, and Judge Priscilla Richman agreed with the outcome. Seven judges dissented. Wilson, an appointee of President Trump, had dissented in July when a panel of the same court reached the opposite conclusion in the case.

"Controlling illegal immigration is, no doubt, an important and controversial issue of public policy," Wilson wrote. The Constitution, he went on, gives Congress rather than the courts broad authority to set immigration policy and to design the proceedings that carry it out. "Neither we nor the district courts are free to ignore that bedrock principle and rewrite the immigration policy Congress has enacted."

The dispute traces to a change the administration made last year. Breaking with nearly three decades of practice, it began treating noncitizens who had lived inside the country for years as "seeking admission," the same status given to people who had just arrived, a reading that left them ineligible for bond hearings. Bloomberg Law reported that the shift helped set off a wave of habeas corpus petitions from detainees who argued they were being held illegally. The Fifth Circuit had already held that the immigration statutes create no right to a bond hearing in these cases, but district judges kept granting relief on due process grounds. When the government appealed, a panel agreed that due process required hearings. The full court threw out that ruling and took up the constitutional question itself.

Two other Trump appointees wrote separately. Judge James Ho said the habeas petitions, "far from affirming American liberty, are profoundly un-American," because they send the message that the only people above the law are those who broke it to get into the country. Judge Andrew Oldham answered Judge Dana Douglas's charge that the majority rested on "sham history," writing that the writ of habeas corpus does not define "the strike zone," which is left to "Congress, and Congress alone."

Judge Leslie Southwick, joined by five colleagues, wrote in dissent that the court "has constructed an impenetrable wall between the Constitution and these long-term residents." Detention can be a legitimate part of deportation proceedings, Southwick acknowledged, but nothing supports holding someone for as long as a case is pending, "however delayed," with no chance of release. Under longstanding Supreme Court precedent, he wrote, it is a noncitizen's "presence and residence" in the country, not a technical admission, that carries due process protection. Judge Catharina Haynes agreed with his basic points but would have confined them to residents like the petitioners, who have lived in the country for more than a decade, have no criminal history and have relatives who are U.S. citizens.

Douglas wrote a separate dissent, joined by four judges, arguing that "the majority opinion detonates the core of the Due Process Clause." Judge Stephen Higginson, writing for himself and five other dissenters, said the court went wrong when it first upheld the policy on statutory grounds and should have revisited that reading to avoid the constitutional concerns.

Lawyers for the men denounced the decision. "Today's ruling is an affront to the U.S. Constitution," said Rebecca Cassler, a senior litigation attorney at the American Immigration Council who argued the case, in a joint statement with the National Immigration Project. Cassler said the ruling leaves the right to due process "hollow for immigrants in Texas, Louisiana, and Mississippi." Ellie Norton, a supervising attorney at the National Immigration Project, said the case involves three fathers who have spent years in the United States supporting children who are U.S. citizens, and that the ruling "opens the door to more people being locked up for no reason."

The Fifth Circuit's position is unusual among the federal appeals courts. Only one other circuit has upheld the detention policy, while nine have ruled against it, according to Bloomberg Law. The Supreme Court has agreed to decide whether the policy correctly interprets the immigration statute, a separate question from the constitutional issue the Fifth Circuit resolved on Friday. Thousands of immigrants are detained in the circuit's states, particularly Texas and Louisiana.