window.dotcom = window.dotcom || { cmd: [] }; window.dotcom.ads = window.dotcom.ads || { resolves: {enabled: [], getAdTag: []}, enabled: () => new Promise(r => window.dotcom.ads.resolves.enabled.push(r)), getAdTag: () => new Promise(r => window.dotcom.ads.resolves.getAdTag.push(r)) }; setTimeout(() => { if(window.dotcom.ads.resolves){ window.dotcom.ads.resolves.enabled.forEach(r => r(false)); window.dotcom.ads.resolves.getAdTag.forEach(r => r("")); window.dotcom.ads.enabled = () => new Promise(r => r(false)); window.dotcom.ads.getAdTag = () => new Promise(r => r("")); console.error("NGAS load timeout"); } }, 5000)

What is the 1798 law that Trump used to deport migrants?

Sofia Ferreira Santos
BBC News
Secretaria de Prensa de la Presidencia/Handout via Reuters Police officers escort alleged  of the Venezuelan gang Tren de Aragua recently deported by the US government to be imprisoned in the Terrorism Confinement Center (CECOT) prisonSecretaria de Prensa de la Presidencia/Handout via Reuters

At core of US President Donald Trump's hardline immigration policy is his use of a 1798 wartime authority allowing presidents to detain or deport the natives and citizens of an enemy country.

While the Alien Enemies Act was enacted to prevent foreign espionage, the Trump istration has invoked it as the legal basis for the deportation of hundreds of alleged gang .

In March, the US deported 261 alleged Venezuelan gang to a notorious jail in El Salvador. Of those,137 were removed under the act, the White House said.

Trump has alleged that the migrants were of the Tren de Aragua (TdA) gang "conducting irregular warfare" against the US. However some civil rights groups say the Trump's use of the act is illegal and discriminates against immigrants based on their ancestry.

What is the act?

The Alien Enemies Act grants the president of the United States sweeping powers to order the detention and deportation of foreign enemies.

It was ed in 1798 when the US believed it would enter a war with .

The act states that "whenever there shall be a declared war [...] or any invasion or predatory incursion shall be perpetrated, attempted, or threatened" against the US, all "subjects of the hostile nation or government" could be "apprehended, restrained, secured and removed, as alien enemies".

When else has it been used?

The act has only been previously used three times - all during times of conflict involving the US.

It was last invoked in World War Two, when people of Japanese descent - reportedly numbering about 120,000 - were imprisoned without trial. Thousands were sent to internment camps.

People of German and Italian ancestry were also interned during that time.

Before that, the act was used during the War of 1812 and World War One.

What have the courts said?

Judges in New York, Colorado and Texas have ruled against Trump's use of the law to deport Venezuelans.

The Supreme Court ruled on 7 April that Trump could use the Alien Enemies Act to deport alleged gang , but deportees must be given a chance to challenge their removal.

That prompted civil rights groups to file lawsuits seeking to protect Venezuelans who may be targeted by the act. Several lower courts imposed temporary orders blocking deportations.

Weeks later, the Supreme Court was again asked to intervene to stop deportations under the act. On 19 April, it ordered the Trump istration to pause the deportation of a group of Venezuelans detained in north Texas after their lawyers argued they had not been told about their right to contest the decision in court.

On 1 May, Trump-appointed federal judge Fernando Rodriguez ruled that the US president cannot use the Alien Enemies Act to deport Venezuelan migrants. This was the first time a federal judge had ruled the use of the act was "unlawful".

But on 13 May, a federal judge in Pennsylvania, Stephanie Haines, said Trump could use the Alien Enemies Act to remove accused gang from the state. She also ruled they must be given at least 21 days notice and an opportunity to challenge their deportations.

What has Donald Trump said?

At his inaugural address in January, he said he would invoke the act to "eliminate the presence of all foreign gangs and criminal networks bringing devastating crime to US soil".

In his proclamation on 15 March, Trump invoked the wording of the act by accusing TdA of threatening an "invasion" against the US. He declared its "liable to be apprehended, restrained, secured, and removed as alien enemies".

Trump has repeatedly attacked judges who have issued rulings critical of his use of the act.

In March, federal judge James Boasberg attempted to stop the use of the law to carry out the deportations, but the White House said this had "no lawful basis", and that the removals had already taken place.

This led to a back-and-forth between the judge, located in Washington DC, and the government. Boasberg dismissed the government's response to his order as "woefully insufficient", and warned of consequences if the Trump istration had violated his ruling.

Donald Trump hit back on social media, saying Boasberg should be impeached and calling him a "grandstander".

One of the president's top aides, Stephen Miller, recently said the istration was "actively looking at" suspending habeas corpus.

The legal principle - which literally means "you should have the body" - allows for a person to be brought before a judge so the legality of their detention can be decided by a judge.

What have others said?

Watch: Attorney says 'no question' that US deportations violate law

Trump's decision has been criticised by rights groups. The American Civil Liberties Union (ACLU) sued to stop the removals on the grounds that the US was not at war.

Speaking to BBC News, Lee Gelernt, a lawyer with the ACLU, said: "There's no question in our mind that the law is being violated."

Elora Mukherjee, director of the Immigrants' Rights Clinic at Columbia Law School, said the istration was "pushing the bounds of executive authority, especially on immigration issues".

"When the executive branch wilfully disregards clear and specific court orders, as the istration did with the [Venezuelan] deportation flights, the checks-and-balances system established by the U.S. Constitution is at risk, and our constitutional democracy is threatened," she said.

Katherine Yon Ebright, counsel at the Brennan Center for Justice, said that Trump's use of the Alien Enemies Act was illegal.

"The only reason to invoke such a power is to try to enable sweeping detentions and deportations of Venezuelans based on their ancestry, not on any gang activity that could be proved in immigration proceedings", she added.

Venezuela criticised Trump's use of the act, saying it "unjustly criminalises Venezuelan migration" and "evokes the darkest episodes in the history of humanity, from slavery to the horror of the Nazi concentration camps".