Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A third federal judge on Tuesday ruled against the Trump administration's campaign to end the Deferred Action for Childhood Arrivals program for young immigrants living in the country illegally, ordering the administration not only to continue processing applications but also to resume accepting new ones.

U.S. District Judge John Bates of the District of Columbia was withering in his 60-page ruling, calling the administration's attempts to end the program "arbitrary," "capricious," "virtually unexplained" and "unlawful."

Bates stayed the ruling for 90 days to give the Department of Homeland Security time to come up with better arguments for scrapping the program, known as DACA. If it doesn't, he wrote, he will enter an order reinstating DACA in its entirety.

White House Press Secretary Sarah Huckabee Sanders called the judge's ruling "wrong" on Wednesday, and said it was "good news for smuggling organizations and criminal networks."

DACA allows the children of immigrants who were under 16 when their parents brought them into the country illegally, and if they arrived by 2007, to remain in the United States without fear of deportation. Those given DACA status must renew it every two years.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The Trump administration had sought to phase out the program starting last month, but two previous federal rulings stalled its efforts. Neither of those rulings — by judges in New York and San Francisco — ordered the government to resume accepting new applications for protection under DACA, making Bates' ruling the strongest so far.

"Each day that the agency delays is a day that aliens who might otherwise be eligible for initial grants of DACA benefits are exposed to removal because of an unlawful agency action," Bates wrote.

In February, the U.S. Supreme Court declined to hear the administration's appeal of the San Francisco ruling.

In his ruling, Bates said the administration failed to give a sufficient reason for moving to cancel the program last fall, finding that a letter from Attorney General Jeff Sessions offered "scant legal reasoning" and failed to cite any federal law with which DACA was in conflict.

The government did no better, the judge said, by saying that keeping the program going would probably face a legal challenge from states opposed to it.

Bates gave both sides until July 27 to file a joint report "stating whether DHS has issued a new decision rescinding DACA and whether the parties contemplate the need for further proceedings in this case."

It wasn't clear whether the Justice Department could immediately appeal the ruling, given that Bates contemplates further proceedings.

The decision was issued the night before the Supreme Court is to hear courtroom arguments on one of the centerpieces of the Trump administration's immigration policy — the proclamation restricting travel from mostly Muslim countries, better known as the "travel ban."

The American Civil Liberties Union, one of the plaintiffs in the two cases that Bates reviewed, called the ruling "a huge blow to the Trump administration's bottom line."

"DACA is constitutional, deal with it," the ACLU said.

California Attorney General Xavier Becerra, who took one of the first legal actions against the administration's decision last year, also welcomed the ruling, calling it on Twitter a victory for Dreamers, as DACA recipients are known, and "for everyone who has boldly fought in court."