Police say a man with a loaded handgun was buzzed into an elementary school near Philadelphia and was later arrested after trying to get inside nearby houses.

Darby Borough Police Chief Robert Smythe says the man, 21-year-old Nazher Sabree, was recognized as a former student by an office employee and allowed into Park Lane School in Darby on Friday. Sabree told the principal he was looking for a bag he'd lost and she escorted him out of the building.

He was then seen trying to get inside nearby houses and police were notified. He says Sabree threatened officers with the gun before he was arrested.

Smythe says Sabree had been acting erratically outside the school earlier in the day. No one was harmed.

The school district says in a statement it is investigating the incident.