A handgun was found when a student at William Floyd High...

A handgun was found when a student at William Floyd High School in Mastic Beach was searched with a metal detecting wand, the school district said. Credit: Newsday / John Paraskevas

Suffolk County detectives have charged a 14-year-old student after he was found in possession of a loaded handgun at William Floyd High School in Mastic Beach on Friday afternoon, according to police. 

At 1:18 p.m., minutes before the high school's regular 1:34 dismissal, the high school student was "brought to an administrator’s office for possible vaping," according to a statement the William Floyd school district released Friday afternoon. 

"When the student was searched with a metal detecting wand, it was discovered that the student was in possession of a handgun," the statement reads. The loaded weapon was then "confiscated and the police were immediately notified."

Suffolk detectives charged the teen with second-degree criminal possession of a weapon and criminal possession of a weapon on school grounds, according to a police department news release.

The juvenile, whom police have not identified due to his age, was being held overnight Friday at the Suffolk County police's Seventh Precinct. The teen was to be arraigned as a juvenile offender at First District Court in Central Islip on Saturday, police said Friday evening.

A spokesperson for the Suffolk County District Attorney's Office could not be immediately reached Sunday.

"The student will be dealt with through the criminal justice system," the district said in its statement Friday. "In addition to any criminal charges, the student will also be subject to severe consequences according to the school district code of conduct."

County detectives also have opened an investigation, a department spokesperson confirmed. They said it is ongoing and asked anyone with information to contact the Seventh Squad at 631-852-8752.

Suffolk Police Officer David Mascarella is back on the job after causing a 2020 crash that severely injured Riordan Cavooris, then 2. NewsdayTV's Andrew Ehinger and Newsday investigative reporter Paul LaRocco have the story. Credit: Newsday/Kendall Rodriguez; Jeffrey Basinger, Ed Quinn, Barry Sloan; File Footage; Photo Credit: Joseph C. Sperber; Patrick McMullan via Getty Image; SCPD; Stony Brook University Hospital

'It's disappointing and it's unfortunate' Suffolk Police Officer David Mascarella is back on the job after causing a 2020 crash that severely injured Riordan Cavooris, then 2. NewsdayTV's Andrew Ehinger and Newsday investigative reporter Paul LaRocco have the story.

Suffolk Police Officer David Mascarella is back on the job after causing a 2020 crash that severely injured Riordan Cavooris, then 2. NewsdayTV's Andrew Ehinger and Newsday investigative reporter Paul LaRocco have the story. Credit: Newsday/Kendall Rodriguez; Jeffrey Basinger, Ed Quinn, Barry Sloan; File Footage; Photo Credit: Joseph C. Sperber; Patrick McMullan via Getty Image; SCPD; Stony Brook University Hospital

'It's disappointing and it's unfortunate' Suffolk Police Officer David Mascarella is back on the job after causing a 2020 crash that severely injured Riordan Cavooris, then 2. NewsdayTV's Andrew Ehinger and Newsday investigative reporter Paul LaRocco have the story.