A US citizen has been charged with attempting to support al-Qaeda and hardline Islamist group al-Shabab.
US prosecutors said Shaker Masri of Chicago sought to travel to Somalia to join al-Shabab, which the US and UK consider a terrorist group.
The case is based largely on Mr Masri's conversations with a paid informant about his plans for violent "jihad".
He was arrested shortly before he was due to fly to California, with Somalia as his final destination, the FBI said.
Mr Masri, 26, was born in Alabama but raised outside the country, and had worked at a non-profit organisation that distributed English translations of the Koran, an FBI affidavit said.
US officials said Mr Masri had told the informant he expected to be given "scholarly duties" upon reaching Somalia, but hoped one day to don a suicide vest. He said he did not expect to reach 30.
Mr Masri has not yet responded to the charges.