The ruling said the government failed to give an adequate justification for ending the federal program. The administration could try again to shut it down by offering a more detailed explanation for its action, but the White House might not want to end such a popular program in the heat of a presidential campaign…

The court said the Department of Homeland Security did not act properly when it ordered the program ended in 2017. In response to legal challenges, lower court rulings allowed DACA to keep going, letting young people in the program to reapply every two years and remain under its protection. Children of illegal immigrants were allowed to remain here if they were under 16 when their parents brought them to the U.S. and if they arrived by 2007.

DACA’s defenders had argued that federal law required the Trump administration to give a detailed explanation before trying to shut the program down — an action that would affect hundreds of thousands of people and the businesses that employ them. Instead, they said, the government simply declared the program illegal. More than 100 business groups, including Apple and Microsoft, sought to preserve DACA, arguing many of their employees are part of the program.