The Supreme Court ruled Thursday that courts cannot review most Department of Homeland Security decisions on which countries qualify for Temporary Protected Status, in an opinion that allowed the Trump administration to strip the deportation protections from immigrants from Haiti and Syria.

The 6-3 decision overturned lower court rulings that had preserved the protections for immigrants who contend the government unlawfully terminated the TPS designations from the two countries.

The decision directly impacts some 350,000 immigrants from Haiti and 6,000 immigrants from Syria.

Justice Samuel A. Alito, Jr., writing for the majority, said the statute that created the program explicitly bars judicial review of the decisions by the secretary of Homeland Security about extending or denying protections.

Congress did not intend for the secretary’s assessment of conditions in countries where TPS holders come from, which determines whether they continue to receive deportation protections, to be reviewed by courts, Alito wrote.