President Donald Trump cannot end protections for undocumented immigrants brought to this country as children, according to a federal court on Thursday.

The U.S. Court of Appeals for the Ninth Circuit ruled that the president lacked authority to eliminate those protections.

In doing so, the ruling upholds a decision from a federal district judge in January.

Trump had proposed ending the protections last year in an effort to spur congressional action to fix the problem.

Related: GOP Control of House Threatened by Discharge Petition

“The rescission of DACA — based as it was solely on a misconceived view of the law — is reviewable, and plaintiffs are likely to succeed on their claim,” the ruling states.

“We therefore affirm the district court’s entry of a preliminary injunction. The district court also properly dismissed plaintiffs’ [Administrative Procedure Act] notice-and-comment claim, and their claim that the DACA rescission violates their substantive due process rights.”

Former President Barack Obama implemented the protections in what has become a highly debated executive order.

The move was to circumvent congressional inaction with thousands of illegal children and young adults at risk, nicknamed dreamers after the Development, Relief, and Education for Alien Minors (DREAM) Act.

Many of them had no choice about becoming illegal immigrants, as they were brought into the country at a very young age.

Who do you think would win the Presidency?

By completing the poll, you agree to receive emails from LifeZette, occasional offers from our partners and that you've read and agree to our privacy policy and legal statement.

“The district court also properly denied the government’s motion to dismiss plaintiffs’ APA arbitrary — and — capricious claim, their claim that the new information-sharing policy violates their due process rights, and their claim that the DACA rescission violates their right to equal protection.”

Trump has made immigration one of his top priorities since his presidential campaign.

He has attempted to crack down on illegal immigration and has initiated travel bans for national security reasons. But along the way, he has been hounded by legal challenges. He is also dealing with a bitter political and legal fight over a caravan of thousands of migrants headed for the southern border — multiple caravans have been reported, too.

President Trump has called the DACA program unconstitutional while also expressing sympathy for the immigrants it is meant to protect. He instead wants lawmakers to approve a permanent fix to the dreamer issue in a bill that also includes funding for the proposed wall on the U.S. border with Mexico, along with terminating chain migration and the draft lottery program.

The Justice Department is likely to appeal the ruling to the U.S. Supreme Court, where conservative justices now hold the majority.

The president is also fighting in two other federal appeals courts, which are reviewing a legal challenge by states, local governments and immigrant rights groups trying to save the program, USA Today reports.

The Justice Department is likely to appeal the ruling to the U.S. Supreme Court, where conservative justices now hold the majority.

And check out this video: