Pakistani Majid Khan, who had lived in the US, agreed to enter the plea in exchange for leniency.
He faces charges which include conspiring with al-Qaeda, murder and attempted murder.
The 32 year old has been in secret US custody since 2003 and alleges that he has been psychologically tortured.
Khan made a public appearance at court for the first time after almost nine years in US custody.
He wore a dark suit and tie, and allowed his lawyer to speak on his behalf during the hearing.
“Mr Khan pleads as follows to all charges and specifications, guilty,” Army Lt Col Jon Jackson, Khan’s military lawyer, said.
When the judge asked him if he agreed with the statement, Khan said: “Yes, sir”.
According to a plea bargain document released by the US government, Khan’s sentence would be capped at 25 years in exchange for pleading guilty.
Khan was first arrested in March 2003, when Pakistani forces raided his family’s home in Karachi. They turned him over to the CIA and he was held in secret confinement overseas, until he was transferred to Guantanamo with other high-value detainees in 2006.