(Reuters) - A U.S. appeals court in California ruled on Thursday that President Donald Trump’s administration must continue a program begun under former President Barack Obama that protects hundreds of thousands of illegal immigrants who were brought into the country as children.

The decision by the San Francisco-based 9th U.S. Circuit Court of Appeals preserves the Deferred Action for Childhood Arrivals (DACA) program introduced in 2012 that has shielded from deportation a group of immigrants dubbed “Dreamers” and has given them work permits, though not a path to citizenship.

Trump has taken a stern stance against illegal immigration. His administration announced plans in September 2017 to phase out DACA, arguing that Obama exceeded his constitutional powers when he bypassed Congress and created the program. DACA currently protects roughly 700,000 young adults, mostly Hispanics, with the number previously as high as about 800,000 people.

The three-judge panel unanimously upheld a federal judge’s January injunction maintaining the program, rejecting the administration’s claim that the decision to end DACA was not reviewable by the courts.

The ruling stems from a lawsuit brought by the University of California, the states of California, Maine, Maryland and Minnesota and others challenging Trump’s move to end DACA.

The judges said the plaintiffs made a plausible case that the Republican president’s plan violates the U.S. Constitution’s guarantee of equal protection under the law. The plaintiffs provided evidence of “discriminatory motivation, including the rescission order’s disparate impact on Latinos and persons of Mexican heritage,” Judge Kim McLane Wardlaw write in the opinion.

Wardlaw was appointed by Democratic former President Bill Clinton. The other two judges, John Owens and Jacqueline Nguyen, were appointed by Obama, a Democrat. Wardlaw and Nguyen also said the plaintiffs would likely win on their claim that rescinding DACA would violate federal administrative law.

FILE PHOTO: Activists and Deferred Action for Childhood Arrivals (DACA) recipients protest against the Trump administration's policies on immigrants and immigration, during a demonstration in Manhattan, New York, U.S., March 1, 2018. REUTERS/Amr Alfiky/File Photo

The ruling represented another legal defeat for Trump concerning DACA, although he has won court victories on other parts of his tough immigration policies.

“Another federal court has said what we’ve always known: that Trump’s decision to kill DACA was wrong and that his sole motivation was to deport 800,000 people of color,” said Sanaa Abrar of the group United We Dream, which advocates for DACA recipients.

On Monday, the administration took the unusual step of asking the U.S. Supreme Court to review the case even though the appeals court had yet to rule.

Trump said on Wednesday he saw potential to work with Democrats, who won control of the House of Representatives this week, but would have to see how the Supreme Court rules on the issue.

The ruling was the first by a federal appellate court to review the merits of the decision to rescind DACA.

‘FAR FROM OVER’

“In California and across our nation, Dreamers significantly enrich our communities as scholars, entrepreneurs, first responders and much more,” said Xavier Becerra, California’s Democratic attorney general. “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.”

The Justice Department did not immediately respond to a request for comment.

San Francisco-based U.S. District Judge William Alsup decided in January the government must continue processing renewals of existing DACA applications while litigation over the legality of Trump’s action is resolved. The administration in February unsuccessfully appealed Alsup’s ruling to the Supreme Court.

Trump’s move last year had called for DACA to begin winding down this past March. Trump’s action sparked an outcry from immigration advocates, business groups, colleges and some religious leaders. There are about 11 million illegal immigrants in the United States, according to the Pew Research Center.

Lawsuits both challenging and supporting Trump’s decision to end DACA have been working their way through the courts, making it likely the issue will wind up in front of the Supreme Court.

The 9th Circuit ruling does not impact a nationwide injunction to preserve DACA issued by U.S. District Judge Nicholas Garaufis in Brooklyn in February, which also has been appealed.

A federal judge in Washington in August ordered the administration to fully restore DACA, including taking new applications. That decision was stayed pending appeal.

Legislation to extend protections for DACA recipients and provide them a path to citizenship failed in Congress this year.