A federal appeals court ruled Thursday that President Trump cannot immediately end the program that shields from deportation young undocumented immigrants who were brought to the country as children.

The unanimous decision by a three-judge panel of the U.S. Court of Appeals for the 9th Circuit makes it more likely that the Supreme Court will settle the question. The Trump administration has asked the justices to add it to the docket for this term.

The Deferred Action for Childhood Arrivals program was begun in 2012 by President Barack Obama and has protected nearly 700,000 people brought to this country as children.

The Trump administration moved to end the program in 2017 after Texas and other states threatened to sue to force an end to the program. Then-Attorney General Jeff Sessions advised the Department of Homeland Security to end the program, saying it was probably unlawful and that it could not be defended in court.

These former congressional interns share why the battle in Congress over the Deferred Action for Childhood Arrivals program is so personal. (Melissa Macaya, Patrick Martin/The Washington Post)

But a number of courts around the country have ruled that the administration’s reasoning was incorrect and kept the program in place. Like the other courts, the panel did not question the administration’s power but faulted its approach.

“To be clear: we do not hold that DACA could not be rescinded as an exercise of Executive Branch discretion,” Judge Kim McLane Wardlaw said in the opinion. “We hold only that here, where the Executive did not make a discretionary choice to end DACA — but rather acted based on an erroneous view of what the law required — the rescission was arbitrary and capricious under settled law.”

The panel of judges, all nominated by Democratic presidents, flatly rejected the administration’s position that courts lacked the power to review the executive branch’s immigration actions.

“The government may not simultaneously both assert that its actions are legally compelled, based on its interpretation of the law, and avoid review of that assertion by the judicial branch, whose ‘province and duty’ it is ‘to say what the law is,’ ” Wardlaw said, borrowing the language of the landmark Marbury v. Madison decision.

Wardlaw said the Obama administration was within its powers to enact DACA because it had to make a choice about how to direct limited resources in deporting undocumented immigrants and decided to spare those who came as children, had not committed crimes and were students or in the military.

“The reality is (and always has been) that the executive agencies charged with immigration enforcement do not have the resources required to deport every single person present in this country without authorization,” she said.

And while the opinion does not purport to decide the wisdom of the policy, Wardlaw was clearly sympathetic.

“It is no hyperbole to say that Dulce Garcia embodies the American dream,” is how she begins the opinion, telling the story of a woman brought to this country by her parents as a 4-year-old who now has a thriving law practice in San Diego.

“Recognizing the cruelty and wastefulness of deporting productive young people to countries with which they have no ties, the Secretary of Homeland Security announced a policy in 2012 that would provide some relief to individuals like Garcia, while allowing our communities to continue to benefit from their contributions,” Wardlaw said.

The panel’s decision keeps in place an injunction from the lower court that allows DACA recipients to renew their applications. According to California Attorney General Xavier Becerra, more than 187,000 people “have regained or extended their DACA protections as a result of the court’s injunction, and hundreds of thousands of additional Dreamers are eligible to do so.”

The administration’s actions on DACA were prompted by a threat by Texas and other states to sue to end the program.

The states had been successful in stopping an extension of a different program proposed by Obama, called the Deferred Action for Parents of Americans and Lawful Permanent Residents program (DAPA).

The administration had been impatiently awaiting the 9th Circuit’s decision on DACA, after oral arguments last spring. It sent a letter to the circuit last month, saying that if the decision was not handed down by Oct. 31, it would ask the Supreme Court to take up the issue.

It filed that request with the Supreme Court last week, but the justices have not acted upon it yet.

The case is Regents of the University of California v. Department of Homeland Security.