A federal judge on Wednesday ordered the Trump administration to halt its practice of “expelling” underage migrants who enter the United States without a parent, a ruling that also cast doubt on the broader legality of the emergency public health measures the U.S. government has used since March to impose strict border controls.

U.S. District Judge Emmet G. Sullivan’s preliminary injunction requires the Trump administration to once more process the humanitarian claims of minors who cross the U.S. border alone, rather than returning them to Mexico or flying them back to their home countries without due process.

The Trump administration implemented emergency public health measures in March aimed at preventing the spread of the coronavirus in border stations, detention centers and child migrant shelters. Under a provision known as Title 42, Section 265, the government has expelled more than 200,000 border-crossers since March, including thousands of underage migrants traveling alone.

While Sullivan did not rule on the legality of the government’s practice of expelling other border-crossers — such as adults and families — his decision questioned the entire basis of the Trump administration’s use of a 19th-century public health provision he said makes no mention of expulsion authorities.

“The Court agrees that the undisputed authority granted in Section 265 is extraordinary and that the COVID-19 pandemic is unprecedented,” Sullivan wrote. “But that is entirely distinguishable from whether or not Section 265 authorizes the Government to expel persons.”

Sullivan’s decision could have wider implications for the incoming Biden administration, which will begin at a time of worsening hardship in Mexico and Central America that could push people north, and as illegal border crossings into the United States have risen to their highest levels in more than a year. President-elect Joe Biden’s team has not said whether his administration plans to continue the expulsion policy, but it has pledged to revoke other Trump administration border-control measures that curb access to U.S. courts and asylum protections.

Wednesday’s ruling was a win for immigrant advocates who argued that the government has been violating anti-trafficking laws and other protections afforded to minors under U.S. law.

“This is an enormous step,” said Lee Gelernt, the deputy director of the Immigrants Rights Project at the American Civil Liberties Union, which sued the government on behalf of a 16-year-old Guatemalan who was expelled from the country after crossing the border in August.

Gelernt said the expulsion policy has not received the attention he thinks it deserves, calling it “the most egregious asylum policy this administration has enacted, because it completely bypasses the entire asylum system.”

“If people need to be tested and quarantined, so be it, but the government can’t just expel them without a hearing,” Gelernt said.

The Guatemalan teen was trying to reunite with his father in the United States after fleeing forced gang recruitment, according to court documents, and U.S. authorities denied him a chance to seek asylum before sending him back to his native country. He is one of the more than 14,000 minors whom the Trump administration has expelled since March, according to ACLU estimates.

Gelernt said the ruling concurred with the ACLU’s position that the Trump administration has exceeded its legal authority.

“Judge Sullivan seems to be of the view that public health laws don’t permit the expulsion of anyone, but he also rested his decision on statutes protecting children and asylum seekers, so we’re continuing to evaluate the ruling,” he said.

The government is expected to seek an immediate stay of the injunction and appeal Sullivan’s ruling.

Chase Jennings, a spokesman for the Department of Homeland Security, denounced Sullivan’s ruling and called him “an activist judge.”

“Today’s dangerous decision is the propagation of one judge’s agenda thousands of miles away from the border, in the face of science and the law, with total disregard for the health of those whose lives will be affected,” Jennings said in a statement. “Along with executive branch partners, DHS is exploring all options to ensure this vital public health tool is quickly reinstated.”

Sullivan’s ruling comes as the number of unaccompanied minors crossing the border has been rising quickly. In September, border authorities took 3,756 underage migrants into custody, the highest total in 14 months.

The Department of Health and Human Services, which oversees the network of shelters for unaccompanied migrant children, has 2,300 minors in its custody, according to Kenneth Wolfe, a spokesman for HHS’s Administration for Children and Families.

The shelters have quarantine protocols in place for minors who are potentially infected with the coronavirus, and the number of occupied beds remains far below the levels of last year’s surge, when more than 10,000 were in HHS custody.

“We have several thousand beds available, but when you take into account covid exposure, that changes the numbers,” Wolfe said, noting that “there are much fewer beds” at facilities near the border that are accommodating unaccompanied minors who might be exposed.

Wednesday’s ruling was the most recent in a series of setbacks to the government’s attempt to suspend child migrant protections during the pandemic. In September, a federal judge ordered the government to stop holding minors in hotel rooms for the purpose of quickly expelling them, directing authorities to use designated HHS shelters instead.