Magistrate Judge Laurel Beeler threw out the bulk of a lawsuit that argued the termination of the Obama-era Central American Minors program was arbitrary and violated the U.S. Constitution.
The program allowed parents legally in the U.S. to apply to bring children or other family members living in Honduras, Guatemala or El Salvador to the U.S.
One of the goals was to discourage children from making the dangerous journey from those countries to the U.S. to be with family.
More than 1,300 people came to the U.S. under the program between 2014 and the end of 2016, according to figures cited in Beeler's decision.
When it ended the program in August 2017, the Trump administration revoked approval for roughly 2,700 additional immigrants who were set to travel to the U.S.
In her ruling, Beeler said the decision to revoke those approvals was arbitrary and capricious and required more analysis and explanation.
Linda Evarts, an attorney with the International Refugee Assistance Project who is representing plaintiffs, said she welcomed that part of the ruling and called the decision "an important first step."
Beeler in a separate order suggested the plaintiffs might be able to revise their lawsuit to address some of her concerns.
The judge, however, found the administration had sufficient policy and legal arguments for its decision to end the Central American Minors program.
The Obama administration granted refugee or parole status to 99 percent of the people it interviewed for the program, giving them a greenlight to come to the U.S., according to State Department figures in Beeler's decision.
The Trump administration argued that immigration law called for a more sparing, case-by-case approach. It also said granting parole broadly created an incentive for illegal immigration and contributed to security problems along the U.S.-Mexico border.
Beeler said the administration rationally concluded that the program was not consistent with its immigration policy and its view of immigration law. She said she was not authorized to second-guess those conclusions.
She also rejected arguments that the decision to end the program violated due process and equal protection.