A federal appeals court in San Francisco ruled against the Trump administration Thursday, saying the government cannot immediately end the DACA program that gives young undocumented immigrants a chance to continue living and working in the U.S. without the threat of deportation.

The administration had sought to block an injunction from lower courts that temporarily prevented the government from going ahead with plans to end the Deferred Action for Childhood Arrivals program.

“The Executive wields awesome power in the enforcement of our nation’s immigration laws,” the ruling said. “Our decision today does not curb that power, but rather enables its exercise in a manner that is free from legal misconceptions and is democratically accountable to the public.”

The ruling comes just days after the Trump administration asked the Supreme Court to take over three cases concerning pending lawsuits that seek to preserve DACA.

DACA, which was created under the Obama administration through executive order, gives some illegal immigrants who were brought to the United States as children the opportunity to receive a renewable two-year period of deferred action from deportation and become eligible for a work permit.

“Today’s decision is a tremendous victory for our young immigrant Dreamers and the rule of law,” said California Attorney General Xavier Becerra. "In California and across our nation, Dreamers significantly enrich our communities as scholars, entrepreneurs, first responders and much more. This fight, of course, is far from over. We will continue to defend Dreamers and DACA all the way to the Supreme Court if necessary.”

Last year, the Trump administration announced its plan to phase out the program, but federal courts have ruled that the phase-out could not apply retroactively and that the program should be restarted.

TRUMP ADMINISTRATION ASKS SUPREME COURT TO FAST TRACK DACA CASES IN BID TO BYPASS NINTH CIRCUIT

The White House fought back on those decisions, which were premised on the idea that the Executive Branch cannot arbitrarily phase out a right that individuals have come to rely on, simply by arguing that the right was established illegally without congressional approval.

DACA proponents have also argued that Trump’s planned termination of the program violates federal law requiring adequate notice-and-comment periods before certain federal rules are changed, as well as other constitutional equal protection and due process guarantees.

Earlier this year, in February, the Trump administration similarly attempted to appeal to the Supreme Court after another lower court ordered that DACA resume. The Supreme Court rejected that request.

The cases are DHS v. Regents of the University of California (18-587) (CA9); Trump v. National Association for the Advancement of Colored People (18-588) (CADC); and Nielsen v. Vidal (18-589) (CA2). The Trump administration is seeking to convince the Supreme Court to consolidate those cases because they make the same substantive objections to the planned DACA rollback, and toss them all out on the merits.

Fox News' Gregg Re contributed to this report.