WASHINGTON — A federal judge ruled Thursday that the U.S. government must stop using a Trump-era public health order to quickly expel migrants with children who are apprehended along the U.S.-Mexico border. U.S. District Judge Emmet Sullivan gave the government two weeks to halt a practice that opponents say is unnecessary and improperly relies on the threat posed by COVID-19 to deprive people of their right to seek asylum in the United States. Sullivan granted a preliminary injunction in response to a lawsuit filed by the American Civil Liberties Union and others on behalf of migrant families, saying they were likely to succeed in their challenge to the use of the public health law known as Title 42. “President Biden should have ended this cruel and lawless policy long ago, and the court was correct to reject it today,” said Omar Jadwat, director of the ACLU’s Immigrants’ Rights Project. The Biden administration was evaluating the ruling and had no immediate comment on whether it plans to appeal. The organization Human Rights First, which has documented cases of kidnapping and sexual assault among families and individuals sent to Mexico under the policy, urged the Biden administration to stop the use of Title 42 before the injunction takes effect in 14 days. “In the wake of this decision, the Biden administration must choose to uphold the refugee laws enacted by Congress rather than permanently stain the president’s legacy by continuing to perpetuate and escalate this illegal and inhumane Trump policy,” said Eleanor Acer, the senior director for refugee protection with Human Rights First. Title 42 was invoked early in the pandemic, under President Donald Trump, ostensibly to help control the spread of COVID-19 in detention facilities by turning back migrants encountered by the Border Patrol without giving them a chance to seek to stay in the U.S.