DEARBORN HEIGHTS, Mich. – Federal authorities arrested a Dearborn Heights resident for his allegiance to ISIS by monitoring his Twitter account and gun purchases.

The arrest comes as Twitter announced it suspended 125,000 ISIS-related accounts over the past six months.

Khalil Abu-Rayyan, 21, was being watched by the feds since May 2015.

He was even having online conversations with an undercover FBI agent.

“I tried to shoot up a church one day,” Abu-Rayyan posted. “It’s one of the biggest ones in Detroit. I had it planned out. I bought a bunch of bullets. I practiced reloading and unloading.”

Prior to those conversations that began in December 2015, the FBI had been following Abu-Rayyan's Twitter activity.

He had been retweeting, liking and commenting on ISIS propaganda.

In conversation's between Abu-Rayyan and the undercover agent, Abu-Rayyan described his desire to commit a martyrdom operation.

The complaint filed in federal court doesn’t specify which Detroit church he was allegedly planning to attack, only that it was close and could seat 6,000 members.

The complaint quotes Abu-Rayyan saying:

“It's easy, and a lot of people go there. Plus people are not allowed to carry guns in church. Plus it would make the news. Everybody would've heard. Honestly I regret not doing it. If I can't do jihad in the Middle East, I would do my jihad over here."

He had also told the undercover agent that a church would be an easy target because people are not allowed to carry guns there and that it would make the news.

The complaint also says that he told the agent he had armed himself with a large knife and would behead people if he needed to.

“It is my dream to behead someone,” he told the agent.

Abu-Rayyan is being held on gun and drug charges. He was pulled over Oct. 7, 2015, for speeding when Detroit police discovered a pistol, sleeping pills and marijuana.

A detention hearing is scheduled for Monday afternoon. Terror charges could be added at a later date.

The complaint can be viewed here.