Authorities say two North Carolina men who were thwarted from traveling to either Syria or Yemen to join a jihadist group have been sentenced to federal prison.

Federal prosecutors said Tuesday that Avin Marsalis Brown and Akba Jihad Jordan were sentenced after earlier pleading guilty to conspiracy to provide material support for terrorism. Both 23-year-olds are from Raleigh.

U.S. District Judge Louise Flanagan sentenced Brown to nearly eight years in prison and Jordan to nine years imprisonment.

Prosecutors said the men spoke repeatedly with an FBI informant about their desire to travel overseas to fight with extremist groups including al-Qaeda and the Islamic State group.

Authorities say that starting in 2013 the pair also discussed weapons to use for attacks. Investigators later recovered an AK-47 assault rifle and ammunition from Jordan's apartment.