The 17-year-old suspect was taken into custody inside a classroom at the School of Business and Industry at 18th and Collowhill streets. Police have not released his identity at this time.
He was reportedly unarmed, but police believe he ditched the gun when he fled. They are now searching for the weapon.
It was around 9:30 a.m. when the suspect and another male allegedly had a dispute at a courtyard outside the Bonnell Building on the campus in the city's Spring Garden section.
Authorities told WPVI-TV that a male reported that he was threatened by the suspect with a handgun. The gunman then allegedly ran into the nearby Winnet Student Life Building.
MORE: Mother, baby found dead in Hollywood apartment
Police ordered everyone in the Bonnell and Winnet buildings to shelter in place as officers swept the area.
No one was injured in the incident.
Philadelphia Police Commissioner Charles Ramsey said the two men have a history. He said they know each other, there was an argument, and one of them allegedly produced a gun.
A spokesperson for the community college says a text alert was sent out notifying students of the incident, and ordering those on campus to shelter in place.
MORE: Texas girl suffers from mysterious condition sneezes 12,000 times a day
Masterman High School, located just across the street from the college, was also placed on lockdown as a precaution, and St. Joseph's Prep says they ordered a "lock-in" - not allowing anyone in or out of their school.
This comes just one day after an online post threatened an attack at a college or university in the Philadelphia area. There is no indication, however, that the incidents are connected.
And it was last May when the Community College of Philadelphia was last placed on lockdown after a student flashed a weapon during a dispute in a chemistry class.