John Walker Lindh, the so-called American Taliban who pleaded guilty to fighting for the former militant leaders of Afghanistan after the terrorist attacks of Sept. 11, 2001, was released from a federal prison in Indiana on Thursday.

John Walker Lindh in a photo obtained in 2002 from a record of religious schools where he studied for five months in Bannu, Pakistan. AP file

A spokesperson for the Federal Bureau of Prisons confirmed Thursday morning that Lindh was no longer in custody.

Lindh, the first U.S.-born detainee in President George W. Bush's "war on terrorism," served 17 years of a 20-year sentence for supplying services to the Taliban and carrying an explosive during the commission of a felony.

The sentence was the result of a plea deal after Lindh, who is now 38, initially pleaded not guilty to 10 counts, including conspiracy to murder U.S. citizens or U.S. nationals, that could have consigned him to three life terms plus 90 years in prison.

The Department of Justice agreed to the arrangement fearing that Lindh's confession wouldn't have been admissible in court because it was obtained without him having been read his Miranda rights and under conditions that his attorneys said amounted to torture.

Lindh was released early from the federal prison in Terre Haute, Indiana, for good behavior. He will spend three years on probation barred from possessing internet-capable devices and forbidden to view or gain access to extremist or terrorist videos, and he must allow the probation office to monitor his internet use.

That's because federal authorities are concerned that Lindh remains a potentially violent Islamic extremist, current and former officials told NBC News this week, pointing to a handwritten letter he sent to NBC Los Angeles in 2015 in which he expressed support for the Islamic State militant group, saying it was "doing a spectacular job."

Lindh's correspondence with journalists in prison, which was subject to U.S. inspection, was cited in a U.S. intelligence document produced in 2016 by the National Counterterrorism Center, which concluded that Lindh "continued to advocate for global jihad and to write and translate violent extremist texts."

Lindh, who grew up near San Francisco, converted to Islam as a teenager and studied Arabic and the Quran overseas. He was with the Taliban when Al Qaeda terrorists attacked the World Trade Center and the Pentagon on Sept. 11, 2001.

Lindh was captured with Taliban forces in the northern Afghan city of Mazar-e Sharif in December 2001 and was part of an uprising by prisoners, during which a CIA officer was killed. He later told reporters that he had fought with the Taliban for months.