The man, identified as Ahmed Abdulkadir Warsame, was brought to New York City on July 4 to face charges in a U.S. criminal court.
He appeared in a New York court on Tuesday morning and pleaded not guilty to providing material support to al Qaeda in the Arabian Peninsula and the Somali group Al Shabaab, U.S. prosecutors in Manhattan said on Tuesday.
Warsame was arrested in April by the U.S. military in the Gulf, he was questioned about anti-terrorism "for intelligence purposes for more than two months" before being read his Miranda rights, the prosecutors said in a statement.
Miranda rights entitle suspects to a lawyer and the right to remain silent.
He was questioned by interrogators from the High-Value Detainee Interrogation Group and the U.S. military, according to an administration official.
President Barack Obama's administration has come under fire by Republicans and even some fellow Democrats over his decision to prosecute some terrorism suspects in criminal courts and not in military courts, where rules for evidence are looser.
In Washington, another senior administration official said Obama's national security team had unanimously recommended the prosecution of Warsame in a criminal court.
The senior Republican on the Homeland Security Committee, Senator Susan Collins, said she did not agree with this decision.
"A foreign national who fought on behalf of al Shabaab in Somalia - and who was captured by our military overseas - should be tried in a military commission, not a federal civilian court in New York or anywhere else in our country," she said in a statement.
LATER WAIVED RIGHTS
After his interrogation, a fresh FBI team came in and was permitted to talk with him, at which time he waived his legal rights and continued to talk for several days, said the first official, who declined to be identified because he was not authorized to talk on the record about matters of terrorism.
Warsame arrived in New York City late on July 4 after being formally arrested the previous day, according to a letter from prosecutors to the U.S. court.
Warsame, said to be in his mid-20s, was indicted on nine charges, including providing material support from at least 2007 to April 2011 to Somali militants al Shabaab and al Qaeda in the Arabian Peninsula (AQAP), two groups designated by Washington as terrorist organizations.
According to the charges, Warsame also worked to broker a weapons deal with AQAP on behalf of al Shabaab.
A joint statement by the Manhattan U.S. Attorney, the FBI and the New York Police Department said he was also charged with "conspiring to teach and demonstrate the making of explosives, possessing firearms and explosives in furtherance of crimes of violence and other violations."