|Al Shabaab fighters in Somaliya|
Mohamed Ibrahim Ahmed pleaded guilty in June to conspiring to provide material support to al Shabaab, and to conspiring to receive military-type training from the group.
Ahmed, 38, was arrested in Nigeria in November 2009 and brought to Manhattan federal court to face U.S. terrorism charges in March 2010. He is an Eritrean national and a permanent resident of Sweden.
"Mohamed Ibrahim Ahmed traveled thousands of miles to align himself with al Shabaab to aid their campaign of terror and to learn their 'ways of war,'" Bharara said in a statement. "Today, his journey ends in prison."
U.S. District Judge Kevin Castel sentenced Ahmed, who has been in custody since June, according to his lawyer Sabrina Shroff, a federal public defender.
The U.S. State Department considers al Shabaab a foreign terrorist organization.
A law enforcement official said that if Ahmed had gone to trial, senior al Shabaab operative Ahmed Abdulkadir Warsame would have been a key witness against him.
On Monday, Bharara's office said Warsame had pleaded guilty to nine U.S. criminal charges.
Unsealed government documents said Warsame commanded "hundreds" of al Shabaab fighters at one point and later served as a liaison between the Somalia-based militant group and Yemen-based al Qaeda in the Arabian Peninsula, regarded as one of al Qaeda's most dangerous affiliates.
Warsame was captured by U.S. authorities in April 2011, held and interrogated aboard a U.S. Navy ship for about two months, then moved into federal custody in New York.
In June, prosecutors recommended a 10-year prison term for Ahmed in exchange for his plea.
Shroff had argued for a five-year prison term, followed by immediate deportation, according to court documents.
"Given his nonexistent connections with the United States, and his complete lack of animosity toward its people, I am very disappointed with the sentence," Shroff said.