An angry federal judge ordered a plane carrying a mother and her daughter to turn around and head back to the United States, hours after being whisked away by U.S. authorities before a court hearing on their deportation status could be finished.

"I know I'm raising my voice, but I'm extremely upset about this," U.S. District Court Judge Emmet Sullivan said during Thursday's hearing. "Somebody … seeking justice in a United States court is spirited away while her attorneys are arguing for justice for her? It’s outrageous. Turn that plane around and bring those people back to the United States."

A Department of Homeland Security official said the agency has complied with the court’s order. By Thursday evening, the mother and her daughter had landed in El Salvador. But they did not disembark, and the plane immediately headed back to Texas, the DHS official said.

Had the family not been returned, Sullivan was prepared to order Attorney General Jeff Sessions, Department of Homeland Security Secretary Kirstjen Nielsen and other senior administration officials to appear in court "to show cause why they should not be held in contempt of court."

The mother in the case, identified in court papers only as "Carmen," is at the center of a lawsuit filed by the American Civil Liberties Union, which challenges a decision by Sessions to exclude domestic and gang violence as reasons for immigrants to be granted asylum.

Sullivan, who sits on the U.S. court in the District of Columbia, threatened to hold Sessions in contempt of court.

The lawsuit seeks a stay of removal for immigrants who, the ACLU argues, could face "grave danger of being raped, beaten, or killed" in their home countries if they are forced to return to them.

Attorney General Jeff Sessions speaks during a Religious Liberty Summit at the Department of Justice July 30, 2018.

Manuel Balce Ceneta, AP

"We are thrilled the stay of removal was issued but sickened that the government deported two of our clients – a mom and her little girl – in the early morning hours," said the ACLU's lead attorney on the case, Jennifer Chang Newell. "We will not rest until our clients are returned to safety."

The ACLU's lawsuit says Carmen and her daughter left their native El Salvador because they feared for their lives amid extortion attempts by gang members. Some of Carmen's friends and co-workers have already been murdered, the ACLU claims.

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.

Named in the ACLU's lawsuit are Sessions, Nielsen, U.S. Citizenship and Immigration Services Director Lee Cissna and Executive Office for Immigration Review Director James McHenry.

Homeland Security's "credible fear" policy instructs authorities to deny asylum to immigrants fleeing domestic abuse and gang violence. Critics have blasted the new policy as an affront to human rights and a systemic attack on immigrant women.

A “credible fear” interview is a threshold screening that determines whether there is a “significant possibility” that an immigrant could show they are eligible for asylum in a full hearing with evidence, witnesses and appeals. If so, they get that chance; if not, they are quickly removed from the United States, according to the ACLU.

Manuela Candelaria Solano holds her young son at the Juventud 2000 migrant shelter in Tijuana, Mexico on June 20, 2018.

02/13

Children in masks are escorted out of the Cayuga Center in New York on June 21, 2018. Many of the children at the center are separated from their parents.

03/13

The Children's Village in Dobbs Ferry, New York, as seen from a drone on June 21, 2018. An undisclosed amount of immigrant children are being held at the facility as part of a contract with the United States Department of Health and Human Services.

04/13

Children in masks are escorted out of the Cayuga Center in New York on June 21, 2018. Many of the children at the center are separated from their parents.

05/13

A group of 30 people made up of Mexican and Central American line up to enter the El Chaparral U.S. entry point in Tijuana, Mexico on June 21, 2018, with the intention of seeking asylum.

06/13

Nancy Gonzalez, 23, of Guatemala, cries at the possibility of being separated from her daughter, Angie, 2, on Wednesday, June 20, 2018, in Nogales, Sonora, Mexico. Francisco Alachea Martin, right, a volunteer nurse, took Gonzalez, her sister, and their daughters to receive medical attention. Gonzalez arrived in Nogales on Tuesday to seek asylum.

07/13

Immigrants seeking asylum status wait to be called for an interview on Wednesday, June 20, 2018, at the DeConcini Port of Entry in Nogales, Sonora, Mexico.

08/13

A volunteer gives directions on how to catch a bus. Nathaly Anai Urbina, 4, sits next to her father at the Catholic Charities of the Rio Grande Valley's Humanitarian Respite Center in McAllen, Texas. About 50 migrants who were released from U.S. government custody on Wednesday, June 20, 2018, were taken to the respite center for meals and supplies before boarding buses taking them north to stay with their families or friends while awaiting immigration hearings before a judge.

09/13

Guadalupe Arcos Avila, 34, shows a picture of her family on Wednesday, June 20, 2018, at the DeConcini Port of Entry in Nogales, Sonora, Mexico. She has been waiting for an asylum interview with U.S. immigration officials for nine days.

10/13

Cell phones charge at the Juventud 2000 migrant shelter in Tijuana, Mexico on June 20, 2018.

11/13

Magali Nieto Romero, 33, sits with her children on Wednesday, June 20, 2018, at the DeConcini Port of Entry in Nogales, Sonora, Mexico. She has been waiting for an asylum interview with U.S. immigration officials for nine days.

12/13

A woman writes names with recent arrivals on a waiting list of people seeking asylum in Tijuana, Mexico on June 21, 2018.

13/13

A woman with two small children enters the El Chaparral U.S. entry point in Tijuana, Mexico with the intention of seeking asylum on June 21, 2018.