Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A California man is accused of trying to open social media accounts for ISIS and planning a possible terrorist attack, federal authorities said Friday.

Amer Sinan Alhaggagi, 22, allegedly sent instant messages to undercover FBI agents and met with them on multiple occasions to discuss the attack, court documents say.

Details of the social media accounts or the attack were not included in those documents, although they allege that Alhaggagi planned to escape to Mexico afterward.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The documents add that he spent "significant" time in Yemen.

Alhaggagi, of Oakland, has been in federal custody since November, when he was he arrested on unrelated identity theft charges. Federal authorities unsealed the indictment detailing the latest charges — attempting to provide services and personnel to a designated foreign terrorist organization — on Friday.

In a statement to NBC News, Alhaggagi's attorney, Mary McNamara, said he was not anti-American and did not support ISIS.

"He is completely nonviolent, and he took no actions to harm anyone," she said. "The evidence we have suggests these charges are based on internet chat conversations that he had with a number of unknown people."

Related: Federal Grand Jury Accuses Hawaii Army Sergeant of Supporting ISIS

McNamara described Alhaggagi as a "very young and naïve man" who appeared to have "allowed himself to be drawn into conversations that he should have been far more suspicious of."

McNamara said Alhaggagi is an American — he was raised in the Bay Area by Yemeni parents — and was unemployed at the time the conversations took place.

He is "well liked, sociable — not an isolated, weird person," she said. "He is not radicalized."