The boy, not identified because he is a juvenile, told authorities he brought the gun to school because he was being threatened.
In court, prosecutors alleged they found a blue bandanna on the boy, a sign he might be part of the Crips gang. They also said the boy was involved in an incident at the school March 15, but would not elaborate further.
Frederick County state's attorney Charlie Smith says there have been cases in the county of kids bringing guns to school, but this one is different.
"A lot of times they are not loaded. They are brought to school as a show of force, so to speak. Oftentimes they are obtained by a youth from their parent. But this was a situation where it was loaded, he did have ammunition," he says.
The boy's stepmother told the judge the 15-year-old is polite and respectful, adding she and her father were very surprised at his arrest. The woman went on to say they had just moved to the area in November, and that her stepson may have gotten involved with the wrong crowd as he was trying to make friends.