(Reuters) - Federal counterterrorism agents have arrested a 29-year-old Michigan man accused of illegally purchasing an arsenal of explosives and other devices capable of mass casualties, according to a criminal complaint filed this week.

Sebastian Gregerson, a Detroit resident who also goes by the name Abdurrahman Bin Mikaayl, is accused of unregistered possession of a destructive device and the unlicensed receipt of explosive materials, according to the complaint.

Officials with the Federal Bureau of Investigation’s counterterrorism squad arrested Gregerson on Sunday, when he met with undercover agents at a gas station and traded a Beretta M9 handgun as payment for several grenades, the complaint said. He was not licensed to receive explosive materials, it said.

Gregerson’s court-appointed attorney could not immediately be reached for comment.

A spokeswoman with the FBI declined to comment on the case.

The FBI began its investigation in April 2015, when an anonymous informant alerted the agency that Gregerson said he was in possession of grenades and bazookas, the complaint said.

Over the past 16 months, Gregerson bought weapons, ammunition and tactical gear including a car pistol holster, hundreds of rounds of ammunition for an AK-47 rifle and commercial-grade road spikes to disable vehicles, the complaint said.

He also bought several training manuals and subscriptions to publications about how to evade capture and “survive dangerous situations,” it said.

In recorded phone conversations with an undercover FBI agent, Gregerson discussed making homemade grenades and ways to attack buildings and law enforcement by using the explosive devices, the complaint said.

It was not clear from the complaint whether Gregerson said he planned to carry out such an attack.

Gregerson is scheduled for a detention hearing on Thursday at the Theodore Levin U.S. Courthouse in Detroit, court documents said.