(CNN) -- A former "enemy combatant" who was held in a South Carolina Naval brig for six years with no charges was sentenced Thursday to eight years and four months in prison, a Justice Department spokesman said.
Ali al-Marri pleaded guilty in federal court in Illinois in May to conspiring to provide material support to a terrorist organization. He could have received a maximum of 15 years in prison.
"This administration is committed to bringing terrorists to justice for their crimes," Justice Department spokesman Dean Boyd said. "Al-Marri, who has been in U.S. custody since December 2001, was dispatched by the highest levels of al Qaeda to carry out its terrorist objectives in America."
A defense attorney for the Qatari citizen, who had been a student at Bradley University in Peoria, Illinois, when he was arrested, said the judge ruled on a lesser sentence to reflect the nearly six years al-Marri already spent at the Naval brig in Charleston, South Carolina.
"We're pleased with the result," said the attorney, Larry Lustberg. "Mr. al-Marri is also very pleased."
Al-Marri was transferred to a federal prison in Illinois in March after President Obama ordered a review of his case. The case was ultimately referred to the Justice Department, which filed charges.
The Pentagon said he trained at a terror camp in Afghanistan, met al Qaeda leaders Osama bin Laden and Khalid Sheikh Mohammed and "volunteered for a martyr mission," according to court documents filed earlier in the case.
According to a copy of his plea agreement, al-Marri admitted that he "knowingly conspired and agreed with Khalid Sheikh Mohammed" to provide support to al Qaeda and to work under the organization's direction and control.
"Between 1998 and 2001, the defendant attended various training camps because he wished to engage in jihad," the document said. While in the training camps and in al Qaeda safe houses in Pakistan, he was known by the name Abdul-Rahman al-Qatari, according to the plea agreement.
Mohammed approached al-Marri in 2001 about his offer to assist al Qaeda, the plea agreement said.
"The defendant was instructed by Khalid Sheikh Mohammed to enter the United States no later than September 10, 2001, with an understanding that he was to remain in the United States for an undetermined length of time," the documents said.
Al-Marri applied to Bradley using the same e-mail address he used to communicate with Mohammed, the plea agreement said. At Bradley, he "rarely attended classes and was in a failing status by the end of his first semester."
On September 21, 2001, al-Marri traveled to another central Illinois university and created five e-mail accounts under different aliases, the documents said. "By this time, the defendant knew that al Qaeda was responsible for the September 11, 2001, attacks on the United States and fully understood why Khalid Sheikh Mohammed had directed him to be in the United States before that date." He used the new e-mail accounts to inform Mohammed of his whereabouts and activities, and also gave him his cell phone number in encoded format, according to the plea agreement.
In addition, he conducted online research "related to various cyanide compounds. The defendant's focus was on various cyanide substances ... the defendant reviewed toxicity levels, the locations where these items could be purchased, and specific pricing of the compounds," the documents said. He also explored obtaining sulfuric acid.
An almanac found at al-Marri's residence was bookmarked "at pages showing dams, waterways and tunnels in the United States," the plea agreement said.
Al-Marri initially was arrested on credit card fraud charges in December 2001. But his continued confinement without charges mushroomed into a major legal case before federal prosecutors filed charges in February.
The Supreme Court ruled on March 6 that al-Marri's case was rendered moot by a decision to indict him on federal conspiracy charges, and granted the Obama administration's request to dismiss his challenge of the president's unilateral authority to detain him indefinitely without charges. He was transferred to civilian custody and taken to Illinois in March.
The court's ruling, however, meant that the larger constitutional issue of the president's power to detain accused terrorists and other criminals in the United States remains unresolved.
CNN's Carol Cratty contributed to this report.