A 16-year-old student was arrested with a gun found in his backpack just two hours after he threatened on social media to shoot up his Queens high school, Mayor Adams announced Thursday.

The arrest — which took place after the Federal Bureau of Investigation alerted the NYPD about the student’s disturbing social media post — was touted by officials as an example of technology and law enforcement working together.

“Our heroic officers did an excellent job of immediately responding to the scene, working with the school staff and school safety agents to investigate the tip, find the student and recover the gun,” Adams said at a press conference. “We’re so grateful that this incident did not end tragically, I don’t want to imagine the world where we would be making a different announceme

See Full Page