Suffolk County police say the 16-year-old boy posted Wednesday on the "Bellport Scholars" Instagram page that there could be a mass shooting at Bellport High School in Brookhaven on Thursday.
Police searched the teen's home Thursday night after several people called 911.
Detectives did not find any weapons.
"We take these threats seriously and will devote our resources to ensuring the safety of our children," Suffolk County District Attorney Raymond Tierney said. "I thank Suffolk police for their swift action here. Upon learning of this threat, they worked with my office to locate and interview the individual responsible for the threat. In addition, they searched and determined that there were no guns in the home. I am convening a School Safety Summit here in Suffolk County with parents, teachers, school officials, law enforcement and my office to work on improving our response to school safety threats and keeping our kids safe."
The teen, whose name is not being released due to his age, is charged with making a terroristic threat and aggravated harassment.
His family looked distraught and said nothing outside court, but in the courtroom, they said their son is a good student who made a very bad mistake.
"Thankfully this incident appears to have been a terrible prank gone wrong," Tierney said. "The accused had no capacity or the intention to act on the threat."
The principal was among those who called 911.
"The reason we were able to make an arrest in a timely manner was because people saw something and they said something," Suffolk County Police Commissioner Rodney Harrison said.
Police say they worked quickly with the FBI and realized the boy posed no real threat.
"We did all our investigative steps to conclusively determine that there were no weapons in the house," Suffolk County Chief of Detectives John Rowan said.
The superintendent has informed students that when the building reopens after the holiday, they'll continue to operate on a modified lockout, and classroom doors will remain closed at all times.
He was placed on Supervised Release Probation with GPS and a 9 p.m. curfew.
The judge also ordered the teen is only allowed home and office visits, with no access to social media, and he will have to submit to alcohol and drug testing.
He is being represented by Legal Aid and is due back in court on May 31.
ALSO READ: Onlookers urged police to charge into TX school: 'Go in there!'
* More Long Island news
* Send us a news tip
* Download the abc7NY app for breaking news alerts
* Follow us on YouTube
Submit a News Tip