In this undated file photo, Albion Central School in Albion, New York is shown.
The three students, all of whom are under 16 years old, are charged with second-degree conspiracy, police said. They were not identified because of their ages.
While there was no specific motive, the plot was initiated after one student was upset over being "shunned" by a classmate, said Joseph Cardone, the district attorney for Orleans County, where Albion is located.
No specific students were targeted, Cardone said.
(MORE: 14-year-old Florida boy arrested after threatening mass shooting at school, police say)
Several "legally possessed" firearms have been seized, according to police.
The students involved "have been removed from school pending the completion of the investigation and disciplinary and other corrective action to ensure the safety of our students," Michael Bonnewell, superintendent for the Albion Central School District, said in a letter sent Wednesday.
He described reports of middle school students sharing "inappropriate and threatening messages and images" through Discord.
Sean Li, director of Trust and Safety at Discord, said in a statement that the company wants it to be a "positive and safe place for all our users."
"We have a zero-tolerance approach to harassment and illegal activity on our platform and take immediate action when we become aware of it," Li said.
New York Gov. Andrew Cuomo warned that "any person posing a threat to our schools will face the harshest possible penalty under the law -- whether or not they intend to actually execute that threat."
"School and police officials across this state continue to be on high alert and I encourage anyone who notices any unusual or suspicious behavior to report it to school administrators and law enforcement right away," Cuomo said in a statement on Friday.