A 15-year-old boy appeared at Montreal's Youth courthouse, accompanied by his parents.
He pleaded not guilty to one count of having uttered a threat.
According to several U.S. media outlets, the threat was made over twitter.
It read, “I hope you know I’m coming to school tomorrow with a Glock 18 and laying down as many kids as I can.”
The Twitter account that allegedly tweeted the threat was deleted by Jan. 18, but the threat had already circulated.
The threat caused all six schools with the Upper Merion Area School District in Pennsylvania to close.
The school district's statement said the suspect was identified as being from Montreal, and they reported the incident to the FBI.
The FBI's legal Attaché office in Ottawa coordinated with Montreal police to take the boy into custody.
"The threatening tweet was sent to the Twitter account of Upper Merion Area School Superintendent, Dr. John Toleno. The threat specifically referenced an individual coming to the school with a gun to harm students," reads the statement.
The boy — who cannot be identified under the Youth Criminal Justice act — was released from custody after agreeing to follow a list of conditions.
Among the conditions, the boy may not be active on social media unless his parents are present.
He is also not allowed to make contact with anyone associated with the Upper Merion Area School District.
He is expected back in court in March.