The Terrorism Confinement Center, or CECOT, is a mega-prison in Tecoluca, El Salvador.
A federal judge on Wednesday ordered the Trump administration to provide hundreds of migrants sent to CECOT, a maximum-security terrorism confinement center in El Salvador, habeas relief, ordering the government to provide the individuals an opportunity to challenge their detention and removal under President Donald Trump's invocation of the Alien Enemies Act.
The order applies to all noncitizens removed from U.S. custody and transferred to CECOT "on March 15 and 16, 2025, pursuant solely to the Presidential Proclamation entitled 'Invocation of the Alien Enemies Act Regarding the Invasion of The United States by Tren De Aragua.'"
Watch NBC 5 free wherever you are

It will not apply to migrants such as Kilmar Abrego Garcia, a Salvadoran native removed from the country around the same time, but for reasons outside of Trump's invocation of the Alien Enemies Act.
“Defendants plainly deprived these individuals of their right to seek habeas relief before their summary removal from the United States — a right that need not itself be vindicated through a habeas petition,” U.S. District Court Judge James Boasberg wrote in the order. “Perhaps the President lawfully invoked the Alien Enemies Act. Perhaps, moreover, Defendants are correct that Plaintiffs are gang members. But — and this is the critical point — there is simply no way to know for sure, as the CECOT Plaintiffs never had any opportunity to challenge the Government’s say-so.”
Get top local stories delivered to you every morning with NBC DFW's News Headlines newsletter.

Trump invoked the Alien Enemies Act in March to target members of Tren de Aragua, a Venezuelan gang deemed a foreign terrorist organization by the administration and accused of engaging in "mass illegal migration to the United States to further its objectives of harming United States citizens." By invoking the war-time law, Trump was able to swiftly detain and remove immigrants he claimed were members of the gang.

One day after invoking the Act, the Trump administration announced it had deported hundreds of alleged Venezuelan gang members across at least two planes to El Salvador, even as Boasberg in a ruling at the time blocked the deportations and ordered any flights carrying migrants subject to the presidential proclamation return to the United States.
The Trump administration challenged the block on its Alien Enemies Act deportations, but the ruling was upheld by the D.C. Circuit of Appeals. The U.S. Supreme Court later faulted the administration for giving the Venezuelan detainees only 24 hours to challenge their deportations before returning the case to an appeals court for further proceedings.
Boasberg in his ruling noted that the Supreme Court unanimously agreed "that those subject to removal under the Act must be allowed to challenge their removability in federal court before being deported."
"Defendants instead spirited away planeloads of people before any such challenge could be made. And now, significant evidence has come to light indicating that many of those currently entombed in CECOT have no connection to the gang and thus languish in a foreign prison on flimsy, even frivolous, accusations," Boasberg wrote.
Boasberg has provided the government a week to propose a plan as to "how they intend to facilitate the ability of the CECOT class to seek habeas relief," making clear the Venezuelan migrants must be granted the opportunity to contest their removal under the Alien Enemies Act, but conceding that "such a remedy may implicate sensitive diplomatic or national-security concerns."
The White House did not immediately respond to a request for comment.
Lawyers for the non-profit groups representing the migrants praised Boasberg's ruling as affirming that the right to due process extends to individuals in the country illegally.
“The court properly recognized that the government cannot send people to a notorious foreign gulag without due process and then wash its hands of the situation,” said ACLU attorney Lee Gelernt, who serves as lead counsel on the case.
This story first appeared on NBCNews.com. More from NBC News: