Investigators say the Northern High student was hiding the weapon in his backpack. The 9mm pistol was loaded.
The 15-year-old freshman wasn't named because of his age. He is charged with resisting a public officer, disorderly conduct, communicating threats to deputies, carrying a concealed weapon, possession of a stolen handgun/weapon on school grounds and possession of a handgun by a minor.
"There were no threats associated with that and all of our kids and staff were safe," said Durham Public Schools spokesperson Tahira Stalberte.
Deputies say the weapon was stolen from a Durham home earlier this summer.
School leaders and the Durham County Sheriff's Office are crediting an anonymous student tip for the discovery.
"Having information reported is important whether it comes from outside the community or from within the school. Those systems are in place to get issues resolved when that information is revealed to us," said Stalberte.