The teenager was charged as an adult with possession of a weapon on school property and other weapon-related charges, police said.
The student is a senior at Magruder High, but was not supposed to be at school on Thursday, Dana Tofig, a county schools spokesman, said in an email.
“He was suspended, but I cannot say why,” Tofig wrote.
A school resource officer saw the suspended student on school grounds at 7:53 a.m. and told him leave, the release said. The teenager refused and was arrested for trespassing, police said.
“During a search of the student’s backpack following the arrest, an unloaded .22 caliber H&R handgun was discovered,” the release said. “This was an older firearm, and it is currently being examined to determine whether it is operable. There was no ammunition recovered with the weapon, and no one was injured.”
Police listed the student's address in Washington DC. The school system has an address in Montgomery County on file, Tofig said.
A letter about the incident was sent to Magruder High School parents on Thursday, Tofig said.