The incident happened on Saturday morning at about 8:30 am at Clinton and Crystal in central Fresno, according to police.
When officers arrived, they rushed the child, Bryson Vang, to Community Regional Medical Center, where he died at 9 am.
"Our hearts are breaking today. This is an avoidable tragedy," said Fresno Police Captain Burke Farrah.
According to police, Bryson's parents were at home when the tragedy took place. The gun is registered.
Officers are providing aid and comfort to the family but are also investigating whether there was any criminal negligence in the way the gun involved was stored.
They have recovered the pistol from the shooting and say so far, it appears the gun was not properly secured.
Farrah said he can't stress enough the importance of gun locks.
"If you have a firearm in your home, we have gun locks for you.... We will be happy to give you one. All you have to do is call us. An unsecured firearm is a horrible tragedy, and no one ever thinks that it will happen to them. I guarantee you this family did not think that this is how their day was going to begin," Farrah said.
RELATED: Community Regional Medical Center partnering with Fresno police to promote gun safety
According to California state law, if someone is killed due to improper storage, family members are given seven days to process the tragedy.
No arrests have been made, and police say they are investigating the incident.
This story is developing and will be updated.