Police said the boy was riding his bike on East 45th Street in East Flatbush at 8:30 Friday night when someone fired a gun.
He was hit in the leg by a stray bullet.
The boy was able to ride home after being hit. Relatives took him to the hospital, where he was recovering.
Police say one shell casing was discovered at the scene.
Investigators haven't announced any arrests.
(the associated press contributed to this report)