An Ohio man was arrested Friday after he allegedly pledged allegiance to the terror group ISIS and bought an AK-47 assault rifle from an undercover agent to use in propaganda videos, federal prosecutors said.

Amir Said Abdul Rahman Al-Ghazi, 38, was arrested in North Olmstead, Ohio, west of Cleveland, and charged with attempting to provide material support to a terrorist organization, possession of a weapon by a felon and distribution of marijuana.

Al-Ghazi, who changed his name from Robert McCollum earlier this year, allegedly told an FBI informant in June that he was "trying to put a squad together" and wanted to mount an attack in the U.S., according to a criminal complaint; in other conversations, he refers to himself as a "cyber jihadi" and said he wouldn’t kill anyone.

Al-Ghazi’s arrest is part of a recent trend in bringing terrorism charges against people in the U.S. who become interested in, and express support for, ISIS through social media.

Investigators say his pro-ISIS social media postings attracted the FBI's attention last August. And since then, he's been under close surveillance, which included the use of two undercover informants. Agents also interviewed him twice last fall.

"Today’s charges are a stark reminder that the radical and dangerous philosophies espoused by groups such as ISIL can be spread in our community through computers and social media," U.S. Attorney Steven D. Dettelbach of the Northern District of Ohio said in a statement, using another acronym by which ISIS is known.

Al-Ghazi, whose home address is in nearby Sheffield Lake, was arrested Friday morning after he allegedly bought an AK-47 from a seller who turned out to be an FBI operative. Prosecutors say he also repeatedly sold marijuana who another person who was a confidential FBI source.