After the fight was stopped, the other student told security staff the teen was carrying a weapon in his backpack, Walker said.
When staffers asked the student to open his backpack, he refused, and the school called police, KIPP Philadelphia CEO Marc Mannella said.
"They were here instantaneously. We were incredibly grateful," he said.
The student did open his backpack for police, who found a .45-caliber handgun inside, Mannella said.
The student was shot last year in Northwest Philadelphia, a law enforcement source said.
Walker said police believe the teenager was hiding the handgun from a parent and had no plans to use it in or around the school.
The school day at DuBois was not interrupted, Mannella said, and parents of the students were notified of the incident by phone. The school also planned to send a letter home with students Wednesday, he said. It was the first time a gun had been found in the school, Mannella said.
Like other charter schools owned by KIPP, DuBois does not have metal detectors.
"We are a school that has a strong school culture and a strong school community," Mannella said. Not having detectors helps build a culture of trust among students and administrators, he added, although the school is "always reevaluating everything that we do."
KIPP runs two middle schools, a high school, and an elementary school in North and West Philadelphia.
All are part of the national Knowledge Is Power Program (KIPP) network of 141 charter schools in 20 states and the District of Columbia that focus on a rigorous college-prep education for low-income students.
Based on KIPP Philadelphia's academic success, the nonprofit Philadelphia School Partnership announced a $1.6 million grant to add 700 to 800 more students.
Inquirer staff writer Martha Woodall contributed to this article.