John Walker Lindh, the Californian who took up arms for the Taliban and was captured by U.S. forces in Afghanistan in 2001, got out of prison Thursday after more than 17 years, released under tight restrictions that reflected government fears he still harbours radical views.

President Donald Trump reacted by saying, "I don't like it at all."

"Here's a man who has not given up his proclamation of terror," he said.

Lindh, 38, left a federal penitentiary in Terre Haute, Indiana, after getting time off for good behaviour from the 20-year sentence he received when he pleaded guilty to providing support to the Taliban.

It was not immediately clear where the man known as the "American Taliban" will live or what he will do. He turned down an interview request last week, and his attorney declined to comment Thursday.

In a Fox News interview, Secretary of State Mike Pompeo decried Lindh's early release as "unexplainable and unconscionable" and called for a review of prison system policies.

The president said he asked lawyers whether there was anything that could be done to block Lindh from getting out but was told no. Trump said the U.S. will closely monitor him.

Under restrictions imposed by a federal judge in Alexandria, Virginia, Lindh's internet devices must have monitoring software; his online communications must be conducted in English; he must undergo mental health counselling; he is forbidden to possess or view extremist material; and he cannot hold a passport or leave the U.S.

FBI counterterrorism officials work with federal prison authorities to determine what risk a soon-to-be-released inmate might pose.

Probation officers never explained why they sought the restrictions against Lindh. But in 2017, Foreign Policy magazine cited a National Counterterrorism Center report that said Lindh "continued to advocate for global jihad and to write and translate violent extremist texts."

On Wednesday, NBC reported that Lindh, in a letter to a producer from Los Angeles-based affiliate KNBC, wrote in 2015 that the Islamic State group was "doing a spectacular job."

Lindh converted to Islam as a teenager after seeing the movie "Malcolm X" and eventually made his way to Pakistan and Afghanistan and joined the Taliban. He met Osama bin Laden and was with the Taliban on Sept. 11, 2001, when al-Qaida terrorists attacked the World Trade Center and the Pentagon.

Lindh was captured on the battlefield after the U.S. invasion of Afghanistan following 9-11 and was initially charged with conspiring to kill Mike Spann, a CIA operative who died during an uprising of Taliban prisoners shortly after interrogating Lindh.

Lindh denied any role in Spann's death. But he admitted carrying an assault rifle and two grenades during his time with the Taliban.

Spann's daughter Alison Spann, now a journalist in Mississippi, posted a letter on Twitter that she said she had sent to Trump. In it, she called Lindh's early release "a slap in the face" to everyone killed on 9-11 and in the war on terror since then, along with "the millions of Muslims worldwide who don't support radical extremists."

Republican Alabama Sen. Richard Shelby and Democratic New Hampshire Sen. Maggie Hassan also expressed concern about Lindh's release in a letter last week to the federal Bureau of Prisons.

"We must consider the security and safety implications for our citizens and communities who will receive individuals like John Walker Lindh who continue to openly call for extremist violence," they wrote.

The bureau defended itself Thursday in a statement that said Lindh's release followed federal laws and guidelines. It said it works closely with outside agencies "to reduce the risk terrorist offenders pose inside and outside of prisons," and added that no radicalized inmate has returned to federal prison on terrorism-related charges.

Moazzam Begg, a former detainee at Guantanamo, now serves as director of outreach for London-based CAGE, which supports the rights of those accused of terror-related crimes. He said the criticism over Lindh's early release is misguided. If anything, Begg said, Lindh was imprisoned too long.

He noted that many of the other Taliban fighters who were sent to Guantanamo as enemy combatants were released much earlier.

As for Lindh's letter in support of the Islamic State, Begg noted that it was written four years ago and that Lindh might not have had full knowledge of the group's atrocities from behind bars.

"Nobody really knows what his views are right now in 2019," he said.

In a statement, Begg said: "It is now time for him to be allowed to restart his life in peace and freedom."

------

This story has been corrected to show that Alison Spann is a journalist in Mississippi, not Alabama.

------

Barakat reported from Falls Church, Va. Contributors include Associated Press writers Ben Finley in Norfolk, Virginia, Kimberly Chandler in Montgomery, Alabama and Eric Tucker in Washington.