John Walker Lindh, the US citizen charged with aiding the Taliban and al-Qaida, today changed his plea to guilty.
Mr Lindh, originally from California, was discovered among Taliban prisoners captured in Afghanistan last December. With long hair, and beard, he gave a hospital bed interview describing his allegiance to the Taliban.
In military interrogations, he also claimed to have met Osama bin Laden once, government lawyers claim.
It was those statements that his lawyers were seeking this week to keep out of the trial before a deal was reached last night.
But in court today Mr Lindh's defence attorney, James Brosnahan, told US district judge TS Ellis III: "There is a change in plea."
Mr Brosnahan did not give details the specific pleas to each count or the terms of the deal.
The charges against Mr Lindh, whose trial was due to begin on August 26, include conspiracy to murder US citizens, contributing services to al-Qaida and the Taliban and using firearms during crimes of violence.
Three of the 10 counts carry maximum terms of life imprisonment for Mr Lindh, who was captured in early December and transferred to civilian custody in late January.
Today's plea decision surprised even the judge, who had opened the hearing by discussing procedures for protecting the identity of confidential witnesses in the proceedings planned for this week.
Mr Lindh's parents were in the courtroom in Alexandria, Virgina, for the announcement. Mr Lindh sat expressionless at the defence table in his green prison jumpsuit as his lawyer made the announcement.