The shooting happened about 9:15 a.m. in the 2700 block of Duffy Street.
San Bernardino County Sheriff's Department officials said the 4-year-old boy got access to the weapon and accidentally opened fire on the toddler.
#BREAKING A 2-year-old child has been shot and killed in Muscoy. @sbcountysheriff is investigating. Neighbor tells #abc7eyewitness that another child got a hold of a gun & accidentally shot the toddler. We are waiting to confirm these details and learn more. pic.twitter.com/dtPj2N18S9— Leticia Juarez (@ABC7Leticia) July 20, 2018
According to neighbors, the child's mother was crying as emergency crews tried their best to save the little girl.
"When they brought her out, she had a little patch right here over her chest. It didn't look like a big hole. They were pumping it as they put her in the ambulance," shared witness Bubba McBath.
The wounded child was transported to a nearby hospital and died about an hour later, sheriff's officials said.
Her mother, supported by another woman, was taken to sheriff's headquarters with other family for questioning.
The boy allegedly involved in the shooting was also visibly distraught as he was carried out of the home.
After several interviews, investigators determined Cesar Lopez, the victim's grandfather, left the gun in a place that was accessible to kids. Lopez was arrested and will be booked for child endangerment and felon in possession of a firearm.
Neighbors said a gun is something no child should have access to.
"Firearms should be put up in a safe place, a gun case or anything, so it won't be easy access for the children..." a neighborhood resident said.
Anyone with information related to the investigation is urged to call (909) 87-3589 or (800) 78-CRIME to remain anonymous.