The high court voted 5-3 to toss a ruling by the U.S. 9th Circuit Court of Appeals which said immigrants deserved the right to bail hearings every six months. The ruling means immigrants could be detained indefinitely.
"Immigration officials are authorized to detain certain aliens in the course of immigration proceedings while they determine whether those aliens may be lawfully present in the country," Justice Samuel Alito wrote on behalf of the majority opinion.
The lower court also said immigrants can only be detained beyond the initial six-month period if prosecutors proved it was justified.
"To impose a rigid six-month rule like the court of appeals did is really a mistake," Solicitor General Ian Gershengorn said in November on behalf of the government, which appealed the 9th Circuit's ruling.
The Supreme Court's decision gives leverage to the Trump administration, which has sought a crackdown on undocumented immigrants, some of whom have been detained in immigration raids. Some have been kept in detention for months, some more than a year, awaiting court hearings.
The American Civil Liberties Union denounced the Supreme Court ruling, saying the lives of thousands of immigrants are at risk.
"The government's practice of locking up immigrants indefinitely, without even a hearing to determine if they pose a risk of flight or danger to the community, as they defend their right to remain in the U.S. is horrific," the organization said. "Many will ultimately win their deportation cases, but would be forced to unjustly suffer first."
The Supreme Court decision vacates the 9th Circuit's ruling, sending it back to the lower court for reconsideration. Justice Elena Kagan recused herself from the vote and Justices Stephen Breyer, Ruth Bader Ginsburg and Sonia Sotomayor dissented.