A Nigerian national who served as a propagandist and recruiter for al-Qaida's Yemeni affiliate was sentenced to 22 years in prison by a U.S. federal court in Brooklyn, New York, Wednesday.

Lawal Babafemi, 35, pleaded guilty last year to providing material support to a designated foreign terrorist organization, al-Qaida in the Arabian Peninsula.

During his time with the Islamist group, he worked on AQAP's media operations, including its magazine Inspire, prosecutors said. He also wrote rap lyrics on behalf of the group, hoping to extend its appeal to young Westerners.

Prosecutors said AQAP leaders paid Babafemi almost $9,000 in cash to recruit other English-speakers from Nigeria to join the terrorist organization.