BOSTON — A Massachusetts man accused of stockpiling weapons and threatening to assassinate President Barack Obama, bomb police stations and attack a mosque is due in court for a detention hearing.

Joseph Garguilo is scheduled to appear in U.S. District Court in Boston on Wednesday.

The 40-year-old Holliston man was arrested last month on a charge of possessing ammunition, which violated the terms of a recent restraining order filed by his ex-wife.

The FBI says a raid of his home turned up assault rifle parts, incendiary materials, ammunition and handwritten notes threatening violence against Muslims.

A friend told federal authorities that he was afraid Garguilo was “about to snap.”

Garguilo’s attorney, Mark Meehan, says his client “denies making any threats to anybody.” Garguilo is being held without bail.