A 13-year-old boy brought an unloaded gun to his Bronx middle school Thursday morning, police said.

The gun was found in the boy’s backpack at the Bronx Park Middle School on Wallace Avenue in Allerton at about 9:40 a.m., according to police. There are no metal detectors in the school, a source said.

The boy was taken into custody at the school, which shares a building with the Bronx Green Middle School, cops said.

The Department of Education said it was notifying families about the incident.

“Nothing is more important than the safety of students and staff,” spokeswoman Toya Holness said in a statement. “The NYPD immediately responded and safely recovered an unloaded gun from Bronx Park Middle School. Students and staff are safe, families are being notified, and we are supporting the school to ensure appropriate follow-up action is swiftly taken.”

The incident happened just a week after a student fatally stabbed his classmate and injured another at a Bronx high school.

The number of weapons seized in city schools has increased nearly 50 percent so far this year, according to the NYPD.