A federal judge ordered the government to return an asylum-seeking mother and her daughter to the US after the Trump administration revealed in a Thursday court hearing that they had sent the migrants to Central America while the court was still considering their case.

The judge, Emmet Sullivan, said it was unacceptable the government had deported the family and threatened to hold the US attorney general, Jeff Sessions, in contempt if the situation was not resolved.

“This is pretty outrageous,” Sullivan said. “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,” he continued. “This is not acceptable.”

Q&A Have you been affected by Trump's zero tolerance immigration policy? Show We want to shine a light on the lasting repercussions of the policy by telling the stories of those affected, from the migrants themselves to the public employees tasked with implementing assembly-line justice. Fill the form here to share your story with us.

The dramatic hearing was part of a lawsuit the American Civil Liberties Union (ACLU) and Center for Gender & Refugee Studies filed on Tuesday, alleging the Trump administration was unfairly preventing thousands of migrants fleeing violence in Central America from seeking asylum in the US.

The ACLU said the government had on Wednesday assured the court that no plaintiff in the case would be deported before midnight on Thursday.

“This disregard for commitments made to the court and the life or death circumstances that these immigrant women and children are facing is beyond unacceptable,” the ACLU said in a statement.

In court on Thursday, Sullivan also temporarily blocked the US from deporting plaintiffs in the lawsuit, most of whom are women fleeing sexual abuse and gang violence.

Those protected by the judge’s order include the lead plaintiff, who is referred to by the pseudonym Grace. In the suit, Grace said her partner of 22 years, and his two gang member sons from another relationship, repeatedly beat and threatened to kill her and her children.

She sought police protection in 2016, but they did not protect her and Grace fled Guatemala, because she felt she wouldn’t be safe in the country because of her partner and his sons’ gang affiliation, according to the suit.

Her asylum attempt appeared to have been thwarted by new rules introduced by the Trump administration in June, which block courts from granting asylum to victims of domestic abuse and gang violence.

The judge’s decision on Thursday, however, means plaintiffs can remain in the US, where they are being held in detention facilities, while Sullivan considers the case.

Sessions and other Trump appointees have dramatically shifted how the federal government speaks about asylum, going as far as to suggest in public communications the unproven claim that asylum is a routinely abused legal loophole.

“We also have dirty immigration lawyers who are encouraging their otherwise unlawfully present clients to make false claims of asylum, providing them with the magic words needed to trigger the credible fear process,” Sessions said last year.

The justice department did not immediately return a request for comment.