Jacob Butze-Maille, 17, was arrested and charged with threats to commit murder and intimidation of a witness, among other charges.

Prosecutors said he told a classmate that he was going to buy an AK-47 assault rifle and that he hated everyone at the high school and was going to shoot them. He is accused of telling the classmate he would shoot her first if she told anyone.

Essex County District Attorney spokeswoman Carrie Kimball Monahan said prosecutors argued Friday that the student was dangerous and should be held.

The court ordered Butze-Maille held until a hearing in January.

Police said with the suspect in custody, there is "no danger to Methuen High School students or faculty."