A 13-year-old seventh-grader has been charged as a juvenile with firearm offenses after he brought a loaded semiautomatic handgun to one of the city's top public schools, the Gen. George A. McCall Elementary School, in Society Hill, police said Thursday.

The boy, a student at the school on South Seventh Street near Delancey, had brought the gun in his backpack to the K-8 school Wednesday morning. He was arrested after another student alerted school officials, who called police. The school was placed on lockdown for about 35 minutes.

A police source said Thursday that the teen did not say why he brought the gun to school, but there was no indication he intended to use it there. The .40-caliber pistol was loaded with 15 bullets, the source said.

The boy lives in East Falls with his mother and told police that he found the gun in an alleyway while walking one day, the source said. It was not clear when or where he allegedly found it.

The gun had been reported stolen in 2013, the source said. The circumstances of the theft were not immediately known.

The boy, whose name was not released because he was charged as a juvenile, did not give police a formal statement.

Officer Troy Brown, a police spokesman, said the boy was charged with carrying a firearm without a license, a third-degree felony, as well as three misdemeanor charges — illegally carrying a gun on the street, possession of an instrument of crime, and possessing a weapon in school. He was released from custody and will face a hearing in Family Court.

School District of Philadelphia spokesman Lee Whack said in a text message Thursday that because the student is a minor, he could not say what changes the school might make because of the incident, why the student attends McCall even though he lives outside its catchment area, or whether he will return.

McCall Elementary was awarded a 2017 National Blue Ribbon for its high academic achievements from the U.S. Department of Education in September, and was named the top-performing K-8 in Philadelphia by the School District last year. The school, which educates 700 students, takes students from neighborhoods including Society Hill and Chinatown.