The incident took place when 20-year-old Prabhat Kumar was handling the sten gun of his father, Parshuram Rai posted at Phulwarisharif Police Station.
Rai was getting ready to report for his duty, city SP Satyaveer Singh said.
The gun was fired and the bullet hit three-year-old Aryan in the neck who was in the lap of his grandmother, Singh said.
Families of the victim as well as the accused are tenants in the same building, Singh said, adding that the firing seemed to be accidental in nature.