The 14-year-old boy was holding a gun when it went off near West 92nd and South Throop streets around 12:50 a.m. Wednesday.
He was transported to Advocate Christ Medical Center, where his condition stabilized. He is expected to recover.
A police source said the gun belonged to the older boy, and that they were playing with it inside his bedroom. When the younger boy accidentally shot himself, the 15-year-old hid the weapon. He was taken into custody and charges are pending against him.
The Sun-Times Media Wire contributed to this report.