It happened around 12:30 a.m. Thursday in the 3400 block of Ridge Avenue.
Arriving officers found the 12-year-old sitting on the front steps of a home.
Police said he had been shot once in the left leg and was bleeding heavily.
The boy was taken to the hospital in stable condition.
The 12-year-old told police he was not sure where the shooting happened.
Police found a blood trail leading to the home. Small said they discovered the crime scene on a third-floor bedroom; a bullet was found on the bed.
Police said the boy may have been hanging out with kids who live at the home.
"We're not certain of the circumstances of this shooting of the 12-year-old," Small said. "We're not sure if this was an accidental shooting, possibly, or a self-inflicted shooting. We're not certain at this time."
At least three other children were in the property with the 12-year-old at the time of the shooting, Small said. They were being questioned by detectives.
The City of Dreams Coalition says the gun violence involving youth has got to stop.
"You can't work on the whole city at one time, but you can start block by block," said Outreach Leader Lee McIntosh.
Starting in West Philadelphia, the anti-violence nonprofit is working to make their streets safe.
"We want people to come out on the block make it a safe zone, the men stand in the corners in a good way," said McIntosh.
The 6abc Data Journalism team found this year, 94 children under the age of 18 have been shot in Philadelphia, which is up about 45% from 65 children shot this time last year.
In Prices Corner, Delaware a 12-year-old was fatally shot on Wednesday.
"Everyday in America, eight children are unintentionally shot with firearms inside the home," said Scott Charles, Trauma Outreach Manager Temple Hospital.
Charles runs Safe Bet at Temple Hospital, a program providing free gun locks to families, no questions asked.
Five-thousand have already been distributed in the last 5 years.