(CBS News) — A federal judge in Washington, D.C. on Friday ordered the Trump administration to restore the program that deferred deportation for certain undocumented immigrants who came to the country as children. Judge John Bates said in a 25-page decision that the Trump administration had failed to justify the decision to end the Obama-era program known as Deferred Action for Childhood Arrivals, or DACA.

Bates called President Trump’s decision in September to end the program “arbitrary and capricious” and the Department of Homeland Security’s “legal judgment” was “inadequately explained.”

READ MORE: San Bernardino Investigators Say Loma Linda Sexual Predator May Have More Underage Victims That Have Not Yet Come Forward

The judge said in his decision that he would delay his ruling for 20 days to give the government time to respond and appeal.

In April, Bates an appointee of former President George W. Bush, ruled that the decision to end DACA  “was unlawful and must be set aside.” Friday’s ruling upheld that decision.

READ MORE: Drone Video: Great White Sharks Off California's Coast Are More Common Than You Think

The Justice Department said in April that Bates’ ruling “doesn’t change” its position on DACA. Bates had given the federal govenrment 90 days to offer a better legal justification for ending the program.

DACA was signed in 2012 by former President Obama to defer deportation for more than 700,000 undocumented immigrants, known as Dreamers, who were brought to the U.S. as children. Mr. Trump had given mixed signals about the program, saying at one point that “we love the Dreamers.”

But in September, Attorney General Jeff Sessions ended the program, calling it an “unconstitutional” overreach of executive authority that caused great legal concern after Congress initially rejected the legislative proposals to extend similar benefits to undocumented immigrations.

MORE NEWS: 'Just Not Fair': Gascón Drops Bid For Death Penalty In Killing Of 10-Year-Old Anthony Avalos

(© 2018 CBS Interactive Inc. All Rights Reserved.)