The boy was taken to St. Francis Hospital around 9:00 a.m. by his mother, a 25-year-old woman, and that's where police were called.
Investigators say the boys found a handgun and were playing with it when it went off at their home in the 900 block of North Madison Street.
Police were informed the weapon had also been taken to the hospital and was in the custody of hospital security.
The boy underwent surgery at the Alfred I. duPont Children's Hospital where he was in stable condition.
The bullet went into the boy's leg and ended up near his ankle.
Police say the mother of the child was at home at the time of the shooting.
Detectives continue to investigate the origins of the weapon and how it came to be in the residence. No charges have been filed at this time.