Upon their arrival, police said, officers recovered a .45-caliber handgun and took the student into custody.
Police said the weapon is registered to someone outside the city but has not been reported stolen. Investigators are working with the Gun Violence Task Force and the Pennsylvania Attorney General's Office to track down the owner and determine how the teen acquired the gun.
"It's a bad scenario," said Lt. John Walker, of Southwest Detectives. "Fortunately, nobody was injured and now the gun is in police possession."
The student's name is being withheld because he is a juvenile, although he has had "very minor contact" with police, Walker said. According to Walker, the altercation stemmed from a fight last week over a female.
In addition to criminal charges, the student could face expulsion, said Marc Mannella, chief executive and founder of KIPP Philly.
KIPP DuBois is not equipped with metal detectors. Mannella said it was the first time a student had been caught with a gun at a KIPP school.
"We're a small school; we're a very close community," Mannella said. "It's our belief that the way you provide safety in a small school and a close community is by empowering everybody to make sure our school is safe, and today it worked."
On Twitter: @ChroniclesofSol