CRANFORD — The teacher who threatened to shoot up the Orange Avenue Elementary School was unhappy with his new assignment as a special education teacher.

Matthew Acosta, 33, of Kenilworth, was arrested last Friday by Cranford police for making a terroristic threat against the school.

Acosta was turned in by a teacher with whom he regularly confided, according to an affidavit of probable cause, which said that Acosta last Thursday said he had a meeting with a colleague who he believed was "out to get him."

The colleague said that Acosta told her that he would "probably just bring his gun and shoot up the place." His colleague asked if he was joking, to which Acosta said "not you" and asked where she would be during a certain time of the day. The colleague again asked if he was joking and he said "yeah, yeah," police reported in the court document.

The colleague, whose identity was not disclosed, felt she should report the conversation to administrators.

According to the affidavit, Acosta had been at the school since May and had several disciplinary infractions because he was having a hard time in his new role as a special education teacher.

He was charged with one count of third-degree terroristic threats and one count of fourth-degree risking widespread injury or damage.

During a detention hearing on Thursday, a judge said Acosta would remain in jail until he undergoes a mental health evaluation, according to NJ.com.