A federal judge in Washington halted a deportation in progress Thursday and threatened to hold attorney general Jeff Sessions in contempt after learning that the Trump administration started to remove a woman and her daughter while a court hearing appealing their deportations was under way.

“This is pretty outrageous,” US district judge Emmet Sullivan said after being told about the removal. “That someone seeking justice in US court is spirited away while her attorneys are arguing for justice for her.

“I’m not happy about this at all,” the judge continued. “This is not acceptable.”

The woman, known in court papers as Carmen, is a plaintiff in a lawsuit filed this week by the American Civil Liberties Union (ACLU). It challenges a recent policy change by the Justice Department that aims to expedite the removal of asylum seekers who fail to prove their cases and excludes domestic and gang violence as justifications for granting asylum in the United States.

Attorneys for the civil rights organisation and the Justice Department had agreed to delay removal proceedings for Carmen and her child until 11:59pm Thursday so they could argue the matter in court.

But lead ACLU attorney Jennifer Chang Newell, who was participating in the court hearing via phone from her office in California, received an email during the hearing that said the mother and daughter were being deported.

During a brief recess, she told her colleagues the pair had been taken from a family detention centre in Dilley, Texas, to the airport in San Antonio for a morning flight.

After being informed of the situation, Mr Sullivan granted the ACLU’s request to delay deportations for Carmen and the other plaintiffs until the lawsuit is decided, and ordered the government to “turn the plane around”.

‘Families belong together’ protests over Trump immigration policy Show all 8 1 /8 ‘Families belong together’ protests over Trump immigration policy ‘Families belong together’ protests over Trump immigration policy Mishawaka, Indiana AP ‘Families belong together’ protests over Trump immigration policy Washington DC AFP/Getty Images ‘Families belong together’ protests over Trump immigration policy New York Mayor Bill De Blasio speaks in Tornillo, Texas alongside the many other US mayors who have called for detained immigrant children to be reunited with their families AP ‘Families belong together’ protests over Trump immigration policy Albuquerque Mayor Tim Kelle leaves a teddy bear as a gift for detained immigrant children in Tornillo, Texas AP ‘Families belong together’ protests over Trump immigration policy Seattle Mayor Jenny Durkan and Los Angeles Mayor Eric Garcetti leave sandals as gifts for detained immigrant children in Tornillo, Texas AP ‘Families belong together’ protests over Trump immigration policy San Diego, California EPA ‘Families belong together’ protests over Trump immigration policy US embassy, Mexico City AFP/Getty Images ‘Families belong together’ protests over Trump immigration policy San Diego, California EPA

Justice Department attorney Erez Reuveni said he had not been told the deportation was happening that morning and could not confirm the whereabouts of Carmen and her daughter.

The ACLU said later that government attorneys informed them after the hearing that the pair was on a flight to El Salvador.

A spokeswoman for US Customs and Immigration Enforcement, which implements deportations, did not respond to questions about why Carmen and her daughter were removed from the country.

“In compliance with the court’s order, upon arrival in El Salvador, the plaintiffs did not disembark and were promptly returned to the United States,” a Homeland Security official said Thursday evening.

Eunice Lee, who is co-counsel for the plaintiffs in the case and co-legal director at the University of California Hastings Centre for Gender and Refugee Studies, said: “It must have been absolutely terrifying for them to think they would be returning to a country where they raised very credible claims of persecution and death. It’s outrageous to me that while we were working around the clock, filing briefings for this case’s early morning hearing, that people in the government were actively arranging for Carmen’s deportation.”

The Justice Department declined a request for comment.

To qualify for asylum, migrants must show that they have a fear of persecution in their native country based on their race, religion, nationality, political opinion or membership in a “particular social group”, a category that in the past has included victims of domestic violence and other abuse.

Carmen fled El Salvador with her daughter in June, according to court records, fearing they would be killed by gang members who had demanded she pay them each month or suffer consequences. Several coworkers at the factory where Carmen worked had been murdered, and her husband is also abusive, the records state.

Under the fast-track removal system, created in 1996, asylum seekers are interviewed to determine whether they have a “credible fear” of returning home. Those who pass get a full hearing in immigration court.

In June, Mr Sessions vacated a 2016 Board of Immigration Appeals court case that granted asylum to an abused woman from El Salvador. As part of that decision, Mr Sessions said gang and domestic violence in most cases would no longer be grounds for receiving asylum.

“The mere fact that a country may have problems effectively policing certain crimes – such as domestic violence or gang violence – or that certain populations are more likely to be victims of crime, cannot itself establish an asylum claim,” Mr Sessions wrote at the time.

The ACLU lawsuit was filed on behalf of 12 migrants from Honduras, El Salvador and Guatemala – three of them children – all of whom failed their initial “credible fear” interviews.

Two of the children and their mothers were deported before the suit was filed. None of the adults had been separated from their children as part of President Trump’s “zero-tolerance” policy.

The lawsuit says Mr Sessions’ ruling, and updated guidelines for asylum officers that Homeland Security issued a month later, subject migrants in expedited removal proceedings to an “unlawful screening standard” that deprives them of their rights under federal law.

Asylum seekers previously had to show that the government in their native country was “unable or unwilling” to protect them. But now they have to show that the government “condones” the violence or “is completely helpless” to protect them, the lawsuit says.