SAN DIEGO (AP) — A federal judge ruled that the Trump administration must resume a program that has shielded hundreds of thousands of young immigrants from deportation but gave it 90 days to restate its arguments before his order takes effect.

The ruling by U.S. District Judge John D. Bates in Washington, if it survives the 90-day reprieve, would be a new setback for the administration because it would require the administration to accept requests from first-time applicants for the Deferred Action for Childhood Arrivals program. Two nationwide injunctions earlier this year applied only to renewal requests.

Bates said the administration’s decision to end DACA, announced in September, relied on “meager legal reasoning.” He invited the Department of Homeland Security to try again, “this time providing a fuller explanation for the determination that the program lacks statutory and constitutional authority.”

The judge, ruling in favor of Princeton University and the NAACP, wrote Tuesday that the administration’s explanation was “particularly egregious” because it didn’t mention that many of the hundreds of thousands of beneficiaries had obtained jobs and pursued education based on the assumption that they would be allowed to renew.

The Homeland Security Department didn’t immediately respond to a request for comment. The administration said in September that it would phase out DACA over six months, calling the program started in 2012 under President Barack Obama an abuse of executive power. It said it was forced to act because Texas and other states threatened to sue, raising the prospect of a chaotic end to the program.

Princeton President Christopher L. Eisgruber said he was “delighted.”

“While the decision does not fully resolve the uncertainty facing DACA beneficiaries, it unequivocally rejects the rationale the government has offered for ending the program and makes clear that the (Department of Homeland Security) acted arbitrarily and capriciously,” he said.

In January, U.S. District Judge William Alsup in San Francisco ruled that the administration failed to justify ending the program and his nationwide injunction forced the administration to resume accepting renewal requests within a week. U.S. District Judge Nicholas G. Garaufis in New York issued a similar ruling in February.

The U.S. Supreme Court denied the administration’s unusual request to leapfrog appeals courts on Alsup’s injunction in February, ensuring that DACA would stay for at least several months and perhaps until well after midterm elections in November. The 9th Circuit Court of Appeals put its review of Alsup’s decision on fast track, but legal experts don’t expect a decision until June at the earliest. From there, it is expected to go to the Supreme Court.

A federal judge in Maryland has ruled in the administration’s favor.

Nearly 690,000 people were enrolled when the Trump administration said in September that it was ending the program, eight out of 10 from Mexico. To qualify, they needed to have arrived before their 16th birthday, been under 31 in June 2012, completed high school or served in the military, and have clean criminal records. The two-year-permits are subject to renewal.