A northeast Ohio man was arrested Friday on a criminal complaint alleging he attempted to provide support to the Islamic State terrorist group while living in the Cleveland area.

Amir Said Abdul Rahman Al-Ghazi, 38, was arrested in the Cleveland suburb of North Olmsted while trying to buy an AK-47 assault rifle for $400 from an undercover FBI agent, authorities said. An affidavit that accompanied a criminal complaint said he had chatted with confidential sources about buying the weapon to use in an Islamic State recruiting video.

Al-Ghazi legally changed his name from Robert McCollum earlier this year, and agents found a sword and an Islamic State flag during a search Friday of McCollum's apartment in the Cleveland suburb of Sheffield Lake.

The affidavit alleges Al-Ghazi began using social media sites in July 2014 to pledge his support for the militant group and its leader and to recruit people to join the group. He also made various references while chatting online with FBI sources that he wanted to stage terrorist attacks in the U.S., including the derailment of a train, according to the affidavit.

He initially told one of the FBI sources that he wasn't interested in becoming a martyr, but did say he'd be willing to cut off the head of his non-Muslim son if Muslims were to go to war in the U.S. Later, he told a source that he wanted to kill non-Muslims and wrote in an online chat: "You don't fear death anymore its like walking thru a door for a martyr u know."

"It is clear that no area is immune from the influence of ISIL and its recruitment machine," Stephen Anthony, agent in charge of the Cleveland FBI field office, said in a statement. "We hope this arrest will serve as a strong message to others who may consider providing support to terrorists."

An FBI spokeswoman said there's no evidence Al-Ghazi traveled to the Middle East.

It wasn't clear late Friday whether Al-Ghazi had an attorney who could comment on his behalf.

Robert McCollum has a criminal history in Cuyahoga County, where Cleveland is located, for drug offenses and being a felon in possession of a firearm. Al-Ghazi also is charged in the complaint with drug distribution for allegedly selling 2 kilograms — nearly 4 ½ pounds — of marijuana to a confidential informant starting in February 2014.

An FBI agent first talked to Al-Ghazi in the fall of 2013. The FBI spokeswoman said a terrorism task force had been alerted to Al-Ghazi's online activity.