U.S. District Judge Kristi DuBose imposed the sentences on 26-year-old Randy Lamar Wilson and Mohammad Abdul Rahman Abukhdair, 29.
The men pleaded guilty earlier this year to charges of conspiring to provide material support to terrorists.
Prosecutors say the two men met over the Internet and Abukhdair moved from New York to Mobile, where Wilson lived. The two had become business partners before their arrests a year ago.
Federal prosecutors portrayed Wilson as an Islamic radical who wanted to reunite with Omar Hammami, an Alabama native who became a jihadist in Africa.
Somali rivals killed Hammami in September.
The two men were arrested separately last year in Georgia. Abukhdair was taken into custody at a bus station; Wilson was arrested as he was about to board a flight to Morocco.
Dubose said she believed FBI agents and other federal investigators that the two men planned to travel to Africa to join violent jihadists.
"Mr. Wilson seemed well informed as to where he could do the greatest service in the jihadist fight," she said.
Domingo Soto, Wilson's attorney, said that unlike others sentenced under terrorism laws, his client never trained at a terrorist camp or carried weapons. Soto said his client wanted to move his family to Africa so that they could practice their religion in an Islamic country.
Soto said Wilson was being punished for a "speculative jihad."
Abukhdair's attorney described his client as a cooperative and kind man. He said his client did not want any statement made on his behalf.
DuBose said many of Wilson's family members had written letters praising him has good father, son and husband.
While he may have been good to his family, DuBose told Wilson that it did not mitigate his actions.
"I have sent an enormous amount of time reading the documents," she said. "There is no other reasonable conclusion than your ultimate intention was to cross over the border into Mali and join in a violent jihad," she said.
Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.