The shooting happened just before 5 p.m. Monday on Elm Avenue. Police responded to a report of shots fired and attempted life-saving measures when they arrived, but the boy was pronounced dead at the scene.
Authorities said the two boys were friends and together in a room when a gun was discharged.
"I'm not sure how they got a hold of the gun, but one of them had the gun, didn't realize it was loaded and accidentally fired a shot that struck the other. Unfortunately, that victim passed away," Atwater Police Chief Richard McEachin said.
Investigators are still working to determine exactly what the boys were doing when the shooting occurred.
"At this point, we don't know exactly what they were doing. Investigators are working on that component right now because it was just the two of them," Lt. William said.
The victim was inside his family's home at the time of the shooting.
Police said they do not currently suspect foul play.
"At this point are you guys suspecting any foul play was involved? No. what we're looking at is more of how it happened. We treat every case as a homicide so if that's determined later on, we will investigate it as such," Lt. William said.
Action News has learned the firearm involved was a semi-automatic handgun. Police recovered the weapon and are investigating who owned it.
Atwater Police Chief Richard McEachin said the incident highlights the importance of gun safety and securing firearms from children.
"Your guns should definitely be locked up, where only you have the access to them or other trained adults that they trust have access to them. They should never be in a situation where they are accessible to children," Chief McEachin said.
The victim was days away from returning to school. In a statement to Action News, the Merced Union High School District said it will be providing counseling and mental health support at every school site following the teen's death.
McEachin said the loss will have a lasting impact on students and the community.
"It'll affect all of his classmates, your close friends you see in the summertime but everyone else you go away from during the summer thinking you'll see in the fall and when something like this happens, you go back to school that empty space where they should be," McEachin said.
Police said they do not believe either of the boys had any gang ties and that everyone involved is cooperating with the ongoing investigation.
For news and weather updates, follow Brisa Colón on Facebook, Twitter and Instagram.