Washington CNN  — 

A federal judge on Thursday erupted at the Trump administration when he learned that two asylum seekers fighting deportation were at that moment being deported and on a plane to El Salvador.

DC District Judge Emmet Sullivan then blocked the administration from deporting the two plaintiffs while they are fighting for their right to stay in the US – excoriating the administration and threatening to hold Attorney General Jeff Sessions in contempt.

The government raced to comply with the court’s order, and by Thursday evening the immigrants had arrived back in Texas after being turned around on the ground in El Salvador.

Sullivan agreed with the American Civil Liberties Union that the immigrants they are representing in a federal lawsuit should not be deported while their cases are pending.

The emergency hearing in the case turned dramatic when attorneys discovered partway through the hearing that two of their clients were on a plane to El Salvador.

Lead ACLU attorney Jennifer Chang Newell told CNN after the hearing the administration had pledged Wednesday that no one in the case would be deported until at least midnight at the end of Thursday. But during a recess in the proceedings Thursday, she got an email from attorneys on the ground in Texas that her client, known by the pseudonym Carmen, and Carmen’s daughter had been taken from their detention center that morning and deported. After investigating during recess, she informed government attorneys and Sullivan what had happened.

“Oh, I want those people brought back forthwith. … I’m not asking, I’m ordering,” Sullivan said upon learning what had happened, which Justice Department attorney Erez Reuveni confirmed, according to a transcript of the hearing.

Sullivan later added he was “directing the government to turn that plane around either now or when it lands, turn that plane around and bring those people back to the United States. It’s outrageous.”

Sullivan then threatened to hit Sessions with contempt, saying that if the immigrants weren’t returned he was going to order officials to explain “why people should not be held in contempt of court, and I’m going to start with the attorney general.”

The judge apparently grew visibly agitated, assuring Reuveni in court that it wasn’t “personal.”

“I know I’m raising my voice, but I’m extremely upset about this,” the judge said. “This is not acceptable.”

Sullivan continued with the hearing, which was near its end, but kept reflecting on how he was “really upset” and found it “pretty outrageous” that “somebody in the pursuit of justice … is spirited away while her attorneys are arguing for justice for her.”

The lawsuit was brought on behalf of immigrants referred to only by their pseudonyms in court: Grace, Mina, Gina, Mona, Maria, Carmen and her daughter J.A.C.F. and Gio.

After the hearing, Sullivan issued an emergency order halting the deportation of any of the immigrants as he considers whether he has broader authority in the case.

Sullivan also ordered that if the two being deported were not returned, Sessions, Homeland Security Secretary Kirstjen Nielsen, Citizenship and Immigration Services Director Lee Francis Cissna and Executive Office for Immigration Review Director James McHenry would have to appear in court and say why they should not be held in contempt.

The lawsuit brought by the ACLU is challenging a recent decision by Sessions to make it nearly impossible for victims of domestic violence and gangs to qualify for asylum in the US. That decision was followed by implementation guidance from the Department of Homeland Security that almost immediately began turning away potentially thousands of asylum seekers at the southern border.

According to their lawsuit, Carmen and her young daughter came to the US from El Salvador after “two decades of horrific sexual abuse by her husband and death threats from a violent gang.” Even after Carmen moved away from her husband, he raped her, stalked her and threatened to kill her, the lawsuit states. Further, a gang held her at gunpoint in May and demanded she pay a monthly “tax” or they would kill her and her daughter. Carmen knew of people killed by their husbands after going to police and by this gang and thus fled to the US.

But at the border, the government determined after interviewing her that she did not meet the “credible fear” threshold required to pursue an asylum claim in the US, and an immigration judge upheld that decision.

The ACLU is using Carmen’s story and the similar experiences of the other immigrants to challenge Sessions’ ruling on asylum.

CNN’s Laura Jarrett contributed to this report.