A Massachusetts man was arrested and charged with threatening the Boston FBI headquarters and Boston City Hall, according to court documents filed in federal court.

>> Read more trending news

Carmen Polito, 35, was arrested at a home in Brookline, but not before throwing a bottle and hitting at least one officer in the struggle, according to authorities.

Police said an FBI agent in Miami, who was in contact with Polito, was threatened in text messages sent from his cell phone.

“I am going to (expletive) stab you, man,” one text message read, according to authorities. “An officer is going to die. I’m ready for the Boston Police Headquarters and FBI.”

Along with the threatening messages, Polito allegedly sent a picture of “a large knife, an AK-47 assault rifle, various police vehicles and pictures of Boston City Hall.”

The unnamed FBI agent got in contact with Boston law enforcement, who tracked Polito down.