LAWRENCE, Mass. (AP) — A man accused of threatening President Barack Obama on Twitter has been arrested on gun charges.

Stephen Perroti pleaded not guilty to nine firearms charges Friday during his arraignment in Lawrence District Court.

A prosecutor told the judge that the U.S. Secret Service contacted Lawrence police regarding threats made against the president. She said that during a search of Perroti’s home in Lawrence on Thursday authorities found an AR-15 assault rifle, three scopes and four high-capacity magazines and ammunition.

“We came to know about this as it was a threat on Twitter,” said Lisa Quinn, special agent in charge of the Boston field office of the Secret Service.

Quinn declined to discuss specifics of the investigation.

Perroti made threats to kill Obama “even if it takes a lifetime,” according to a police report obtained by The Eagle-Tribune newspaper.