FBI agents have arrested two Alabama men accused of plotting to wage violent jihad in Africa.

Mohammad Abdul Rahman Abukhdair, 25, and Randy Wilson, also known as Rasheed Wilson, 25, both U.S.citizens living in Mobile, were arrested Tuesday on terrorism charges. Prosecutors say they planned to travel to Mauritania, in West Africa, intending to prepare to engage in jihad.

Wilson was arrested Tuesday morning in at the Atlanta airport while preparing to begin a journey to Morocco, investigators say. Abukhdair was arrested in Augusta, Ga., at a bus terminal, also beginning a trip to Morocco.

Investigators say the men met online two years ago when Wilson was living in Mobile and Abukhdair was living in Egypt. Last year, prosecutors say, the men were introduced to someone who turned out to be an undercover FBI operative. Court documents say they explained that they had already formulated a plan to wage jihad overseas.

Earlier this year, court documents say, the two thought they detected FBI surveillance, so they threw their laptop computers into Mobile Bay and opened a men's fragrance store to make it appear they had no plans to leave the country. But the actual FBI surveillance continued until they were arrested Tuesday.

The fragrance store closed after four months because of a lack of business.

Pete Williams is NBC News' justice correspondent

More content from NBCNews.com:

Follow US news from NBCNews.com on Twitter and Facebook