(CNN) A federal judge blocked the Trump administration Thursday from transferring to another country an American citizen who has been accused of fighting for ISIS and who has been held by US forces in Iraq for months.

The order, issued by Judge Tanya S. Chutkan, says the Department of Defense is "hereby enjoined from transferring petitioner from US custody."

US government lawyers had entered a filing Tuesday, saying the government planned to transfer the detainee, identified in court documents only as John Doe, to the control of a foreign country, the name of which had been redacted.

The American Civil Liberties Union, which represents the detained US citizen, opposed the transfer and requested that Chutkan block it.

The ACLU praised the judge's decision in a statement Thursday, saying the detainee's transfer would have denied "him the opportunity to win his freedom from a US court."

Read More