Dreamers can breathe a little easier — for now. Photo: Spencer Platt/Getty Images

Just before the beginning of Labor Day weekend on Friday night, a federal judge wrote that the Deferred Action for Childhood Arrivals program was illegal, and would likely fail to pass constitutional muster in the future. And yet, he ruled that it could continue for the time being.

Andrew S. Hanen of the Federal District Court in Texas said that President Obama exceeded his constitutional authority in 2012 when he created DACA, which protects undocumented immigrants brought to the U.S. by their parents from deportation. But, Hanen reasoned, ending the initiative abruptly after six years would create an unreasonable and unhelpful level of chaos. He compared the act of doing so to unscrambling an egg.

“Here, the egg has been scrambled,” Hanen wrote. “To try to put it back in the shell with only a preliminary injunction record, and perhaps at great risk to many, does not make sense nor serve the best interests of this country.”

Hanen had not given much indication that he would be friendly to DACA. In 2014, Hanen blocked an Obama administration program that would have expanded it to include parents of undocumented parents. But that iniative, unlike DACA, had not been implemented before Hanen’s decision.

Though DACA’ s legal status remains precarious, the ruling amounts to a big win for Dreamers and a major loss for the Trump administration. It means that the almost 700,000 people already enrolled in the program can apply for renewals — perhaps until June 2019, when the Supreme Court may weigh in. It also further takes pressure off Congress to enact a legislative fix for the program, a task that had seemed increasingly difficult amid the poisonous backdrop of immigration politics. Still, Hanen wrote that congressional action was the only solution going forward.

“DACA is a popular program and one that Congress should consider saving,” he wrote. But “this court will not succumb to the temptation to set aside legal principles and to substitute its judgment in lieu of legislative action. If the nation truly wants to have a DACA program, it is up to Congress to say so.”

Last September, the Trump administration, led by Attorney General Jeff Sessions, announced that they would end DACA. But since then, multiple federal judges have ruled that the program must continue. Friday’s ruling came in response to a lawsuit filed by Texas and seven other states.

If DACA does wind its way through appeals court and end up before the Supreme Court next year — as seems likely — there’s a good chance that the justices will take a less charitable approach than Hanen, especially with the the likely addition of Brett Kavanaugh this fall.

In its response to Friday’s ruling, the Trump administration chose to focus on Hanen’s assertion that DACA shouldn’t exist.

“As the Justice Department has consistently argued, DACA is an unlawful attempt to circumvent Congress, and we are pleased the court agreed today,” said Devin O’Malley, a Justice Department spokesman.