Jose Lozano, a spokesman for the state Office of Homeland Security and Preparedness, confirmed two arrests at JFK but would not provide details.

NJ.com reported that the two men had been under investigation since 2006 and that an undercover New York City police officer had infiltrated their circle of friends.

The two were identified as Mohamed Hamoud Alessa, 20, of North Bergen, and Carlos Eduardo Almonte, 26, of Elmwood Park, who were arrested waiting to board separate flights to Egypt. Both are believed to be American citizens, NJ.com reported.

They are scheduled to appear Monday in U.S. District Court in Newark.

Authorities told NJ.com that the men planned to join up with al Shabaab, an Islamist group based in southern Somalia. Al Shabaab, whose full name means "Mujahideen Youth Movement," is reported to have had ties to al-Qaida since 2007.

Last year, federal authorities in Minnesota charged 14 men connected to a plot designed to entice young Americans to join Shabaab.