A Maryland man who joined and fought with the Somali terrorist group al-Shabab was sentenced to 35 years in prison on Tuesday, the Justice Department said.

Maalik Alim Jones, 33, of Baltimore pleaded guilty in September to three charges of conspiring to provide material support to al-Shabab, conspiring to receive military training from the terror group, and carrying and using an AK-47 machine gun, rocket-propelled grenades and other destructive devices, federal prosecutors in New York said.

Judge Paul G. Gardephe sentenced Jones in U.S. District Court in Manhattan. His sentence will be followed by five years of supervised release, the Justice Department said.

Prosecutors have said that Jones traveled to Somalia in 2011 to train, work and fight with al-Shabab.

Court documents say that he became a member of al-Shabab's specialized fighting force, known as Jaysh Ayman, and fought against Kenyan government soldiers, and that Jones appeared with other al-Shabab fighters in at least two videos recovered from another al-Shabab fighter.

"U.S. citizens who travel overseas to fight with a terrorist organization — which is what Jones did — betray our country and pose a serious threat to our national security," Assistant Attorney General John Demers said in a statement.

Jones was arrested by Somali authorities on Dec. 7, 2015, as he tried to get a boat to go to Yemen, federal prosecutors said, where he aimed to join the Islamic State terror group.

Jones' defense attorney said in court documents that Jones, a Muslim, "has expressed his sincere remorse" for committing the crimes and "unequivocally states that he was wrong for believing that his religion provided any justification for violence." The attorney did not immediately respond to an emailed request for comment Tuesday night.

Prosecutors said Jones "did not merely join and swear allegiance" to al-Shabab or "engage in isolated or relatively minor acts of support."

"Rather, over the course of more than four years, he fully committed himself to al-Shabab, traveling halfway around the world to join and train with one of its most specialized and violent units," prosecutors said in a May 22 filing. "By his own admission, the defendant took up arms and engaged in battle in furtherance of the organization’s murderous goals."

The Jaysh Ayman group is responsible for killing around 40 people in a 2014 attack on a hotel bar in Mpeketoni, Somalia; an attack on a church in Kenya that killed nine people that same year; and an attack in 2015 that targeted a Kenyan military base, the Justice Department said.

Al-Shabab claimed responsibility for an attack on the Westgate Mall in Nairobi, Kenya, in 2015 that left at least 67 people dead. The group also claimed responsibility for an attack on Garissa University College in Kenya in 2015 that killed 147 people. Jones was not accused of being involved in those attacks.