MUSCOY, Calif. -- A 4-year-old boy accidentally shot and killed his 2-year-old cousin Friday in the town of Muscoy, California, authorities said. The San Bernardino County Sheriff's Department said deputies and first responders arrived at the scene around 9 a.m. local time at a home on Duffy Street.

They said the 2-year-old girl suffered a gunshot wound and was transported to a nearby hospital where she was pronounced dead nearly an hour later.

The victim's grandfather, 53-year-old Cesar Lopez, was arrested and charged with child endangerment and being a felon in possession of a firearm, authorities said. Investigators interviewed several people who were inside the home and said they determined that Lopez left the gun "in an area that was accessible to the children."

Get Breaking News Delivered to Your Inbox

Columbus McBath, a neighbor, told CBS Los Angeles he used to see the little girl playing in the front yard of her home. He said he watched first responders put a child in an ambulance Friday, and that it looked like she was shot in the chest.

"The kid was in the wrong place at the wrong time -- and they didn't know what they had," McBath said.

The sheriff's department said the investigation is ongoing and no additional information is available at this time.

"Have a gun safe, if not a strong-armed box, with a lock on it so this type of situation won't ever happen again," neighbor Tywana Macbeth told KNBC.