Officers and emergency personnel responded to the school around 9:30 a.m.
A teenage student was taken into custody a short time later. Officials say the weapon was a bb gun air pistol designed to look like a Glock handgun.
The teen in custody posted the photo from inside a 10th-grade classroom, investigators say.
"Classroom full of children, he brought a gun to school," said Delaware County District Attorney Jack Stollsteimer.
No one was injured in this incident.
"The good news for everyone in the community is that this incident ended peacefully. The juvenile, who brought what looks to be a firearm to school, has been apprehended," Stollsteimer said.
Emotions were running high as parents showed up. They were outraged that a student brought a gun into the school.
"It's sad to me cause I'm a senior, and I'm graduating this year, and it's like, it's not okay," said Damyah Ware, an Academy Park High School senior.
Students said the lockdown announcement came over the loudspeaker sparking safety concerns.
"It's really scary, like, you never know," said Montae Feggins, an Academy Park High School student.
Some students said they don't feel safe attending school.
"Not after this, not after this. No, I don't feel safe," said Ware.
Parents and guardians outside the school on Friday were outraged
"How many times are we going to come this close to a situation and somebody do get hurt?" said Albert Hughes, whose grandchildren are in the district.
"I'm real anxious, nervous, you know kids shouldn't go through stuff like this, they go to school to learn," said Demetris Alscon, an Academy Park High School parent.
Police said the charges that will be filed for the juvenile will be the same as if he brought a firearm to school.
Stollsteimer said there will be meetings addressing school safety including discussing metal detectors inside the school.
Officials say law enforcement acted quickly.
"We can't have juveniles with firearms. We can't have them do that in school, and we certainly can't have them posting about it because it's going to set off a whole chain of events that could lead to another tragedy where a child is killed," Stollsteimer said.
Chopper 6 showed a person taken into custody. Officials confirm the juvenile was taken into custody without incident. The gun was recovered in the school.
Academy Park High School was the scene of a tragedy last summer in which 8-year-old Fanta Bility was killed by police gunfire. Those officers opened fire after two teens exchanged gunfire outside a football game that night.
Sharon Hill Borough Council voted 6-1 on Thursday night to fire the three officers involved, identified as Brian Devaney, Devon Smith and Sean Dolan.
Each officer was charged with 10 counts of reckless endangerment and one count of manslaughter and involuntary manslaughter, according to the charging documents.
According to court records, all three men had their preliminary arraignments Tuesday morning and each was released on unsecured $500,000 bail.