Washington (CNN) A federal appeals court ruled Friday that the Trump administration's decision to rescind a program protecting young undocumented immigrants who came to the United States as children from being deported violates federal law.

In a 2-1 ruling, the Fourth Circuit Court of Appeals held that the Deferred Action for Childhood Arrivals program's rescission was "arbitrary and capricious" under federal law in part because the Department of Homeland Security "failed to give a reasoned explanation" for the change in policy.

The Trump administration's move to rescind the program was already put on hold by the Ninth Circuit Court of Appeals, which upheld in November a nationwide injunction allowing DACA to remain in effect.

The Department of Justice has a pending request with the Supreme Court to take up an appeal, but the justices have declined to do so, perhaps because they are waiting for the issue to percolate in the courts below.

Judge Albert Diaz, a President Barack Obama appointee, wrote Friday's majority opinion and was joined by Judge Robert King, a President Bill Clinton appointee.

Read More