WASHINGTON, DC – Federal law does not force immigration officials to either give aliens held in federal custody periodic court hearings or release those aliens into the general U.S. population, the U.S. Supreme Court held on Tuesday.

“Every day, immigration officials must determine whether to admit or remove the many aliens who have arrived at an official port of entry,” Justice Samuel Alito began for the Court. Although the “vast majority” of situations are decided quickly, in hard cases federal law authorizes detaining aliens during immigration proceedings.

Alejandro Rodriguez is a Mexican who was in the U.S. legally until he was convicted for drugs and theft in 2004. His lawyers argued that he should not be deported. Although he could leave the United States at any time if he agreed to deportation, he has been in custody since 2004 because he is contesting the deportation process.

He brought this case not only for himself, but for all other aliens in a similar situation. The lower court certified the case as a class action.

Rodriguez’s lawyers made two arguments. First, a complicated statutory argument that several provisions of immigration law together require that he be entitled to occasional bond hearings – they say every six months – without which he must be released back into the general population. Second, if federal law does not entitle him to this, then those provisions of immigration law violate due process rights under the U.S. Constitution.

A federal district judge in California agreed with the statutory argument, and would have ordered Rodriguez released. The U.S. Court of Appeals for the Ninth Circuit affirmed, siding with the him.

On Tuesday, the Supreme Court reversed, in what was mostly a 5-3 decision.

“When a serious doubt is raised about the constitutionality of an act of Congress, it is a cardinal principle that this Court will first ascertain whether a construction of the statute is fairly possible by which the question may be avoided,” explained the Court.

“Despite the clear language” of the relevant provisions of immigration law, Rodriguez’s lawyers argued “that those provisions nevertheless can be construed to contain implicit limitations on the length of detention,” Alito wrote. “But neither of the two limiting interpretations offered by [his lawyers] is plausible.”

“Nothing in the text of [relevant federal law] even hints that those provisions restrict detention after six months,” the Court reasoned. To the contrary, they make clear these statutory provisions “mandate detention of aliens throughout the completion of applicable proceedings” – that is, until there is a final “decision on whether the alien is to be removed from the United States.”

In response to the liberal justices’ dissent arguing that the U.S. Code can be read to entitle aliens to bond hearings every six months, Alito writes that “the dissent evidently has a strong stomach when it comes to inflicting linguistic trauma.”

He goes through several instances of the liberal justices flipping the clear meaning of the statutory provisions and remarks, “The contortions needed to reach these remarkable conclusions are a sight to behold.”

Justice Clarence Thomas concurred in much of Alito’s opinion. But Thomas, joined by Justice Neil Gorsuch, would have dismissed the entire case for lack of jurisdiction. “Congress has prohibited courts from reviewing aliens’ claims related to their removal, except [for] a final removal order or in other circumstances not present here.” Thus, without a final order on whether to deport, Thomas and Gorsuch would hold that courts cannot hear these claims, including to order the alien released.

The case was sent back to the lower courts to consider the constitutional due process argument.

The case is Jennings v. Rodriguez, No. 15-1204 at the U.S. Supreme Court.

Ken Klukowski is senior legal editor for Breitbart News. Follow him on Twitter @kenklukowski.