Some 700,000 immigrant children, many now adults, won a reprieve from deportation on Thursday when a divided U.S. Supreme Court ruled that the Trump administration’s effort to end the program violated federal law.

Chief Justice John Roberts Jr. led the court in ruling 5-4 that the Trump administration had failed to address important factors bearing on its decision to wind down the Deferred Action for Childhood Arrivals program and that failure violated the federal law known as the Administrative Procedure Act.