Three middle schoolers were busted for a plot to use explosives and firearms in upstate Albion, NY to “kill as many people as they could,” police officials said Friday.

The threat was reported to police on Monday after one of the suspects allegedly made remarks towards another student at Albion Middle School — implying a “broader risk to the entire student body,” local Police Chief Roland Nenni told The Post.

Witnesses reported the threat to a staff member who then alerted the police.

Officials discovered licensed firearms, electronic devices, and other supporting materials during the investigation, Nenni said, declining to disclose the details of the materials.

Local and federal officials quickly became involved and arrested the trio on Thursday afternoon, Nenni said.

The kids –– whose identities are being withheld because they are all under age 16 –– communicated the plan via an online app for gamers called Discord.

The scheme was apparently arranged after one of the students was upset over being “shunned” by a classmate, according to ABC.

They even had a set date, which officials also did not disclose, except to say it was “not imminent.”

Still, “This was a credible threat with a plan,” the Chief said.

The kids were charged with conspiracy in the second degree and were issued a desk appearance ticket, the chief added.

The case will eventually go through family court.

Gov. Andrew Cuomo addressed the threat in a statement on Friday,

“The State of New York has zero-tolerance for violence in our schools. I will do everything in my power as Governor to keep our children and our teachers safe. And I want to be crystal clear: 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.”

The investigation remains ongoing.

Additional reporting by Bernadette Hogan