An American citizen suspected of fighting for Isis has spoken with American Civil Liberties Union lawyers as he seeks to challenge his months-long detention in Iraq, a case that could test America’s terrorism policy in the age of Isis.

A new court filing confirms that the American Civil Liberties Union communicated via videoconference earlier this week with the detainee, known only as “John Doe,” and that he intends to challenge the terms of his detention.

“I can confirm DoD facilitated access between the American citizen detained in Iraq and the ACLU,” a Department of Defence spokeswoman said.

According to court filings, the man has been held in Iraq for nearly fourth months after having surrendered to Syrian Democratic Forces, a rebel militia. He has been classified as an “enemy combatant,” a designation that allows him to be held indefinitely.

“The Trump administration illegally denied an American his rights to access a lawyer and a court for nearly four months, but those efforts have finally failed,” ACLU attorney Jonathan Hafetz said in a press release. “Now that our client has secured the judicial review that the government attempted to block, he looks forward to establishing the illegality of his detention.”

Last month, Judge Tanya Chutkan blocked the Department of Defence’s effort to dismiss John Doe’s habeas corpus request and said he was entitled to legal representation.

Syrian Democratic Forces take Raqqa from Isis – in pictures Show all 8 1 /8 Syrian Democratic Forces take Raqqa from Isis – in pictures Syrian Democratic Forces take Raqqa from Isis – in pictures Syrian Democratic Forces fighters celebrate victory in Raqqa atop of military vehicles REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures Fighters of Syrian Democratic Forces march past destroyed buildings as they celebrate victory REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures Fighters of Syrian Democratic Forces gesture the "V" sign in Raqqa REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures Fighters of Syrian Democratic Forces evacuate a civilian from the stadium REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures A civilian prays after she was rescued by fighters of Syrian Democratic Forces from the stadium REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures Syrian Democratic Forces fighters ride atop of military vehicles as they celebrate victory in Raqqa REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures Syrian Democratic Forces fighters celebrate victory in Raqqa REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures A fighter of Syrian Democratic Forces celebrates in Raqqa Reuters

The ACLU has argued that “John Doe” is being illegally detained and barred from exercising his rights as a US citizen, writing in a September letter that “indefinite military detention without charge has proven to be unlawful and illegitimate” and pushing for the US citizen to be availed of his due process rights.

“If the government has legitimate grounds to suspect the citizen fought with Isis, he should immediately be transferred to the federal criminal justice system for criminal charges,” the ACLU wrote.

Indefinitely detaining people as “enemy combatants” is an outgrowth of the post-9/11 war on terror, when Congress passed a measure targeting terrorism suspects who assisted al-Qaeda and the Taliban. Critics have warned that the measure, intended to cover people involved in the 9/11 attacks, has been invoked to justify detaining any suspected terrorists.