Central American immigrants depart ICE custody, pending future immigration court hearings on June 11, 2018 in McAllen, Texas. Thousands of undocumented immigrants continue to cross into the U.S., despite the Trump administration's recent "zero tolerance" approach to immigration policy.  (Photo by John Moore/Getty Images)
John Moore/Getty Images
Central American immigrants depart ICE custody, pending future immigration court hearings on June 11, 2018 in McAllen, Texas. Thousands of undocumented immigrants continue to cross into the U.S., despite the Trump administration's recent "zero tolerance" approach to immigration policy. (Photo by John Moore/Getty Images)
Now playing
01:06
Judge blocks asylum seekers from deportation
President Donald Trump addresses the 73rd session of the United Nations General Assembly, at U.N. headquarters, Tuesday, Sept. 25, 2018. (AP Photo/Richard Drew)
Richard Drew/AP
President Donald Trump addresses the 73rd session of the United Nations General Assembly, at U.N. headquarters, Tuesday, Sept. 25, 2018. (AP Photo/Richard Drew)
Now playing
01:17
Trump to migrants: Make your nations great again
Pool
Now playing
01:51
Trump: I prefer shutdown before midterms
CHICAGO, IL - JUNE 29:  Demonstrators hold a rally in the Little village neighborhood calling for the elimination of the U.S. Immigration and Customs Enforcement (ICE) and an end to family detentions on June 29, 2018 in Chicago, Illinois. Protests have erupted around the country recently as people voice outrage over the separation and detention of undocumented children and their parents.  (Photo by Scott Olson/Getty Images)
Scott Olson/Getty Images North America/Getty Images
CHICAGO, IL - JUNE 29: Demonstrators hold a rally in the Little village neighborhood calling for the elimination of the U.S. Immigration and Customs Enforcement (ICE) and an end to family detentions on June 29, 2018 in Chicago, Illinois. Protests have erupted around the country recently as people voice outrage over the separation and detention of undocumented children and their parents. (Photo by Scott Olson/Getty Images)
Now playing
01:30
HHS refusing to release family separation stats
Now playing
01:01
Reporter to Sarah Sanders: Why did Trump lie?
Now playing
01:28
Trump: ICE agents are mean but have heart
Pool
Now playing
01:23
Trump: Our facilities better than Obama's
trump king of jordan visit
CNN
trump king of jordan visit
Now playing
01:15
Trump: No regrets signing executive order
Immigrant children walk in a line outside the Homestead Temporary Shelter for Unaccompanied Children, a former Job Corps site that now houses them, on Wednesday, June 20, 2018, in Homestead, Fla. (AP Photo/Brynn Anderson)
Brynn Anderson/AP
Immigrant children walk in a line outside the Homestead Temporary Shelter for Unaccompanied Children, a former Job Corps site that now houses them, on Wednesday, June 20, 2018, in Homestead, Fla. (AP Photo/Brynn Anderson)
Now playing
01:54
Children in limbo after Trump executive order
Secretary of State Mike Pompeo listens as President Donald Trump speaks during a cabinet meeting at the White House, Thursday, June 21, 2018, in Washington. (AP Photo/Evan Vucci)
Evan Vucci/AP
Secretary of State Mike Pompeo listens as President Donald Trump speaks during a cabinet meeting at the White House, Thursday, June 21, 2018, in Washington. (AP Photo/Evan Vucci)
Now playing
02:18
White House chaos over immigration reversal
Watched by Homeland Security Secretary Kirstjen Nielsen (L) and Vice President Mike Pence, US President Donald Trump signs an executive order on immigration in the Oval Office of the White House on June 20, 2018 in Washington, DC. - US President Donald Trump on Wednesday signed an executive order aimed at putting an end to the controversial separation of migrant families at the border, reversing a harsh practice that had earned international scorn."It's about keeping families together," Trump said at the signing ceremony. "I did not like the sight of families being separated," he added. (Photo by Mandel Ngan / AFP)        (Photo credit should read MANDEL NGAN/AFP/Getty Images)
MANDEL NGAN/AFP/Getty Images
Watched by Homeland Security Secretary Kirstjen Nielsen (L) and Vice President Mike Pence, US President Donald Trump signs an executive order on immigration in the Oval Office of the White House on June 20, 2018 in Washington, DC. - US President Donald Trump on Wednesday signed an executive order aimed at putting an end to the controversial separation of migrant families at the border, reversing a harsh practice that had earned international scorn."It's about keeping families together," Trump said at the signing ceremony. "I did not like the sight of families being separated," he added. (Photo by Mandel Ngan / AFP) (Photo credit should read MANDEL NGAN/AFP/Getty Images)
Now playing
02:49
What's next after Trump's policy reversal?
Trump meeting 06202018
POOL
Trump meeting 06202018
Now playing
02:33
Trump reverses position on family separations
President Donald Trump signs an executive order to keep families together at the border, but says that the 'zero-tolerance' prosecution policy will continue, during an event in the Oval Office of the White House in Washington, Wednesday, June 20, 2018. Standing behind Trump are Homeland Security Secretary Kirstjen Nielsen, left, and Vice President Mike Pence. (AP Photo/Pablo Martinez Monsivais)
Pablo Martinez Monsivais/AP
President Donald Trump signs an executive order to keep families together at the border, but says that the 'zero-tolerance' prosecution policy will continue, during an event in the Oval Office of the White House in Washington, Wednesday, June 20, 2018. Standing behind Trump are Homeland Security Secretary Kirstjen Nielsen, left, and Vice President Mike Pence. (AP Photo/Pablo Martinez Monsivais)
Now playing
01:52
Trump signs executive order to end family separations
CNN
Now playing
01:18
Trump: Take children away to prosecute parents
THE PRESIDENT meets with the National Space Council  In-House Pool (Pre-set 9:30AM | Final Gather 11:15AM -- Palm Room Doors)
Pool
THE PRESIDENT meets with the National Space Council In-House Pool (Pre-set 9:30AM | Final Gather 11:15AM -- Palm Room Doors)
Now playing
01:40
Trump: The US will not be a migrant camp
(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.