A teenager was busted Wednesday when he tried to bring a loaded gun through security at a Bronx high school, cops said.

The 16-year-old, whose name wasn’t released because of his age, was caught with the weapon and marijuana in his backpack when he went through scanning at the John F. Kennedy High School Campus on Terrace View Avenue around 9 a.m., police said.

A 16-year-old high school student at John F. Kennedy High School Campus in the Bronx was caught trying to bring a loaded gun into the school, according to police.

He was arrested and charged with criminal possession of a loaded weapon and carrying a weapon on school grounds, according to cops.

Cops confiscated $2,700 from him, police sources said. It wasn’t clear how much pot he had on him, cops said.