An American citizen held by the U.S. military without charges for more than a year as a suspected member of the Islamic State in Syria has been freed from custody, officials said.

The man, who has not been named in court filings, was released in a third country Sunday, according to the American Civil Liberties Union, which represented him. The man had been imprisoned since being turned over to American forces in September 2017 after he was captured at a rebel Syrian Democratic Forces checkpoint and he declared U.S. citizenship.

U.S. officials have said they lacked admissible evidence to criminally charge the man, who grew up in Saudi Arabia and is a dual citizen, but detained him as an “enemy combatant.” His extraordinary case set off a year-long legal battle over whether U.S. citizens captured on a battlefield as suspected Islamic State fighters have the right to challenge their detentions.

His release means the government will avoid a binding court ruling on that issue, and specifically over whether the wartime authority granted by Congress after the 2001 terrorist attacks on New York and the Pentagon targeting al-Qaeda and the Taliban extends to the struggle against the Islamic State.

The ACLU called his release a victory for due process and the U.S. justice system.

“My case has shown the worst and the best of my country,” the man said in a statement issued by his lawyers. “No one, no matter what they are suspected of, should be treated the way my government treated me. Once I got the chance to stand up for my rights, the Constitution and the courts protected me.

The man’s ACLU attorney, Jonathan Hafetz, said in a statement, “The victory sends a strong message that the president cannot take away an American’s liberty without due process, and it shows the continuing importance of judicial review.”

Hafetz said after federal courts forced the government to defend its “extreme and inaccurate claim of detention authority, the government opted instead to release him as a free man.”

The man’s release was reported first by the New York Times, which said that his name is Abdulrahman Ahmad Alsheikh and that he has been released in Bahrain, where his wife and daughter are living.

The Department of Defense confirmed the release, saying that after consulting with other agencies it “assesses that even though this individual is detainable under existing [wartime authorities granted by Congress], it is consistent with national security interests to release him from U.S. custody.”

In a statement, an ACLU spokesman said that its client is seeking time and privacy to rebuild his life.

The government has said in court filings that the man was born in the United States, and attended college and studied electrical engineering in Louisiana. The government said he tried to register his 3-year-old daughter as an American citizen on two trips to the United States in 2014.

FBI interrogators said that after his arrest, the man said he worked for the Islamic State guarding a gas field and monitoring civilians, but that he claimed to be a freelance journalist who agreed to work for ISIS to gain his release after it captured him.

The FBI said that he lied about aspects of his travels and that a U.S. military intelligence report on an ISIS recruiting file indicated the man registered with the group in July 2014 as a “fighter,” declining a choice of “suicide bomber.”

The U.S. military had sought to keep the man’s detention secret and opposed his requests for a lawyer, which he obtained after the ACLU sued and a federal judge allowed the organization to contact him. A federal appeals court also upheld the district judge’s decision barring the government from forcibly transferring the man to a third country over his objections.

Rachel Weiner contributed to this report.