RICHMOND, Va. — The federal appeals court ruled Friday the Trump administration acted in an "arbitrary and capricious" manner when it sought to end an Obama-era program that shields young immigrants from deportation.

A three-judge panel of the 4th U.S. Circuit Court of Appeals ruled 2 to 1 that the Trump administration violated federal statue when it tried to end the Deferred Action for Childhood Arrivals program without adequately explaining why. The ruling overturns a lower court ruling a judge in Maryland made last year, which Trump had previously praised via Twitter.

Friday's ruling will not have any immediate effect as other federal courts have already ordered that DACA be kept in place.

The 4th Circuit ruling said the Department of Homeland Security did not "adequately account" for how ending DACA program would affect the hundreds of thousands of young people who "structured their lives" around the program.

"This ruling is the result of a long and valiant battle that our Dreamers have endured in their struggle to keep their families together," said Lizette Olmos, a spokeswoman for Casa de Maryland, the lead plaintiff in the case.

Trump and his Justice Department have argued that the Obama administration acted unlawfully when it implemented DACA. The Justice Department did not immediately return a request for comment.

Preserving DACA is a top Democratic priority, but discussions between Trump and Democrats on the issue have gone nowhere.

Trump's latest immigration plan, unveiled Thursday, does not address what to do about the hundreds of thousands of young immigrants brought to the U.S. as children. White House press secretary Sarah Sanders told reporters that "every single time that we have put forward or anyone else has put forward any type of immigration plan that has included DACA it's failed."

DACA's fate could be decided by the Supreme Court, which is weighing the Trump administration's appeals of other federal court rulings.

The justices have set no date to take action.

If the high court decides it wants to hear the appeals, arguments would not take place before the fall. That means a decision is not expected until 2020, which could come in the thick of next year's presidential contest.