WESTPORT — A student who allegedly threatened to shoot a teacher and had thoughts of executing a mass shooting at Staples High School has been charged with a misdemeanor.

Around 9 a.m. Feb. 27, Westport Police were contacted by Staples High School officials and advised a juvenile male student was overheard making threats to shoot a teacher, police said.

Due to his age, police said they will not reveal the identity of the suspect.

The student who overhead the threat reported it to school officials and when officers and detectives arrived at the high school, the suspect was being interviewed by school administration. Police said it was confirmed the student had thoughts of executing a mass shooting at the high school.

Safety concerns forced Staples High School to “shelter in place” before being dismissed early and the threat prompted a massive investigation involving multiple police departments.

Members of the detective and youth bureaus of the Westport Police ultimately obtained an arrest warrant for and order to detain the student.

In the early morning hours of March 20, the student turned himself in at police headquarters on the outstanding warrant. The juvenile was charged with second-degree threatening, a class A misdemeanor.

“The witness and suspect were interviewed. We spoke to friends and family members and concluded that was the charge that fit the situation,” Lt. Jillian Cabana said.

The Staples student was transported to the Juvenile Detention Center in Bridgeport March 20 and scheduled to appear in court later in the day, police said.

Cabana said she heard the suspect was held at the center only until his hearing and was released following the hearing.

Because the hearing was conducted in juvenile court, the court records related to the case are sealed.

Mark Sherman, a defense attorney with a practice in Stamford, was not involved in the case involving the Staples student, but has handled many juvenile cases throughout his 20-year career. He said the charge against the student seemed appropriate.

“It’s a very fair and measured charge by state prosecutors. It allows the court system to get involved and provide services for the defendant and at the same time, does not ruin his future of reputation,” Sherman said. “There was potential to charge someone with felonies and transfer to adult court but it appears they were very measured and fair to all sides.”

Juvenile court is not about punishing teenagers, the defense attorney explained, but rather, in cases like the one involving the Staples student, about making the incident a teaching moment and offering services, such as anger management counseling and cognitive therapy to youth who may not be getting those services at home.

“The juvenile court is really meant to rehabilitate kids,” Sherman said.

svaughan@hearstmediact.com; 203-842-2638; @SophieCVaughan1