WASHINGTON — The White House violated a court order on deportations to third countries with a flight linked to the chaotic African nation of South Sudan, a federal judge said Wednesday, hours after the Trump administration said it had expelled eight immigrants convicted of violent crimes but refused to reveal where they would end up. The judge’s statement was a notably strong rebuke to the government’s deportation efforts.

In an emergency hearing he called to address reports that immigrants had been sent to South Sudan, Judge Brian E. Murphy in Boston said the eight migrants aboard the plane were not given a meaningful opportunity to object that the deportation could put them in danger. Minutes before the hearing, administration officials accused “activist judges” of advocating the release of dangerous criminals.

“The department actions in this case are unquestionably in violation of this court’s order,” Murphy said Wednesday, arguing that the deportees didn’t have “meaningful opportunity” to object to being sent to South Sudan. The group was flown out of the United States just hours after getting notice, leaving them no chance to contact lawyers who could object in court.

Government attorneys argued that the men had a history with the immigration system, giving them prior opportunities to express a fear of being deported to a country outside their homeland. They also pointed out that the judge had not specified the exact time needed between notice and deportation, leaving room for misunderstanding.

The government calls the deported people ‘true national security threats’

The migrants’ home countries — Cuba, Laos, Mexico, Myanmar, Vietnam and South Sudan — would not take them back, according to Todd Lyons, the acting director of Immigration and Customs Enforcement, who spoke to reporters in Washington. He later said the migrants either came from countries that often do not take back all their deported citizens or had other situations that meant they could not be sent home.

“These represent the true national security threats,” Lyons said at a news conference. Behind him was a display of photos of men he said had been convicted of rape, homicide, armed robbery and other crimes.

Administration officials, who have repeatedly clashed with the courts over their attempts to deport large numbers of immigrants, made their displeasure clear Wednesday.

Homeland Security officials released few specific details about the deportation flight. They said it left Tuesday with eight people on board and said they remained in the department’s custody Wednesday. Officials said they could not disclose the migrants’ final destination because of “safety and operational security.”

The case comes amid a sweeping immigration crackdown by the Republican administration, which has pledged to deport millions of people who are living in the United States illegally.