Federal authorities have arrested a Massachusetts man who they say threatened to kill President Obama, bomb several police stations and attack a mosque.

Joseph Garguilo, 40, was scheduled to appear before a U.S. District Court in Boston on Monday to face a single charge of possessing ammunition, which violated the terms of a recent restraining order filed by his ex-wife.

Around July 27, according to documents connected with the case, Garguilo had acquired parts needed to construct an AR-15 rifle. He also had allegedly stockpiled other weapons including tasers, mace guns, hunting knives and thermite. The documents also accused Garguilo of saying that “he will plant a bomb in police station…and kill as many homeland security officers as he can before they kill him.”

Authorities eventually learned that Garguilo said that he wanted to attack a mosque or kill President Obama. According to an affidavit, Garguilo had told a friend that he wanted to “chain a mosque closed and burn it down.”

Believing he was “about to snap,” the friend reported Garguilo’s behavior, which included stockpiling food and water, Justice Department officials say.

 The FBI arrested Garguilo on Friday after a raid of his Holliston home allegedly turned up assault rifle parts, incendiary materials, ammunition and handwritten notes threatening violence against Muslims.

A neighbor told The Boston Globe that Garguilo frightened neighbors, who would not call 911 when he threw bottle rockets into the street because they wanted to avoid trouble with him. “You can tell the guy’s off,” the neighbor told The Boston Globe, declining to give her name.

Garguilo was ordered held without bail. A hearing is slated for Wednesday. His attorney, Mark R. Meehan, denied he threatened anybody and said the allegations stem from a custody battle over his children.