Updated

A 22-year-old California man has been charged with attempting to support terrorism by allegedly using social media to promote the Islamic State group and offering to join the organization, according to court documents.

Federal prosecutors allege Amer Sinan Alhaggagi "went so far as to meet with undercover agents on multiple occasions to plan a potential terrorist attack," said a court filing unsealed Friday.

Alhaggagi, an Oakland, California, resident, has been in custody since November on unrelated identity-theft charges.

His defense lawyer told the San Francisco Chronicle that the latest allegations are baseless and stem from idle talk in late-night internet chat rooms.

"Amer is a very young and naive person, and it appears that he allowed himself to be drawn into conversations that he should have been far more suspicious of," attorney Mary McNamara said. She said Alhaggagi was unemployed at the time, had just turned 21, and "just got drawn into online communities" with other "young men staying up late at night."

The federal grand jury indictment charged Alhaggagi with attempting to provide material support or resources to a foreign terrorist organization. The case has been assigned to a federal judge in Oakland. An arraignment has not yet been scheduled

Between July 24 and Nov. 29 of last year, the indictment said, Alhaggagi was "opening social media accounts understanding and intending that such accounts were to be used by, and for the benefit and promotion of, ISIS, and personnel, in the form of himself, to a foreign terrorist organization, namely ISIS," using the acronym for the Islamic State of Iraq and Syria.

The terrorism charge is punishable by up to 20 years in prison. The indictment did not give details of the social media accounts or specify how, or to whom, Alhaggagi offered "personnel, in the form of himself" to the terrorist organization.

___

Information from: San Francisco Chronicle, http://www.sfgate.com