(Reuters) - John Walker Lindh, the American captured in Afghanistan in 2001 fighting for the Taliban and vilified as a national traitor, is to be released early from a federal prison on Thursday while some U.S. lawmakers worry he still poses a security risk.

Lindh, photographed as a wild-eyed, bearded 20-year-old at his capture, will leave a federal prison in Terre Haute, Indiana on probation after serving 17 years of a 20-year sentence, according to a prison official.

Now 38, Lindh is among dozens of prisoners set to be released over the next few years after being captured in Iraq and Afghanistan by U.S. forces and convicted of terrorism-related crimes following the Sept. 11, 2001 attacks.

His release brought objections from elected officials who asked why Lindh was being freed early and what training parole officers had to spot radicalization and recidivism among former jihadists.

Leaked U.S. government documents published by Foreign Policy magazine show the federal government as recently as 2016 described Lindh as holding “extremist views.”

“What is the current interagency policy, strategy, and process for ensuring that terrorist/extremist offenders successfully reintegrate into society?” asked U.S. Senators Richard Shelby and Margaret Hassan in a letter to the Federal Bureau of Prisons.

Lindh’s parents Marilyn Walker and Frank Lindh did not immediately respond to requests for comment. Lindh’s lawyer Bill Cummings declined to comment.

Slideshow ( 13 images )

Melissa Kimberley, a spokeswoman for the Terra Haute prison, could not confirm details of Lindh’s release other than it would be on Thursday.

U.S.-born Lindh converted from Catholicism to Islam as a teenager. At his 2002 sentencing he said he traveled to Yemen to learn Arabic and then to Pakistan to study Islam. He said he volunteered as a Taliban soldier to help fellow Muslims in their struggle or “jihad.” He said he had no intention “to fight against America” and never understood jihad to mean anti-Americanism.

Lindh told the court he condemned “terrorism on every level” and attacks by al-Qaeda leader Osama bin-Laden were “completely against Islam.”

While in prison, Lindh successfully lobbied to overturn a ban on group prayer by Muslim prisoners.

A January 2017 report by the U.S. government’s National Counterterroism Center, published by Foreign Policy, said that as of May 2016, Lindh “continued to advocate for global jihad and to write and translate violent extremist texts.”