Immigrants being held for deportation don’t have an automatic right under the law to post bond and be set free, the U.S. Supreme Court ruled Tuesday in a decision that could give the Trump administration more freedom to pursue stiff detention policies for illegal immigrants who show up at the border claiming asylum.

In the 5-3 ruling, the justices also took a dim view of the kinds of class-action lawsuits on behalf of immigrants that have become a key tool for anti-Trump immigrant rights activists, leaving the activists worried about the fates of other cases winding their way through the lower courts challenging President Trump on issues such as illegal immigrant Dreamers and Iraqi deportees.

The ruling was also a rebuke by the high court to the U.S. Court of Appeals for the 9th Circuit, which had its decision overturned.

Justice Samuel A. Alito Jr. chided the 9th Circuit for ignoring the text of immigration laws and creating a legal standard for bail hearings “out of thin air” by requiring that immigrants be given periodic bail hearings.

Read more