At about 5 a.m., deputies were dispatched to the scene in the 1000 block of Apache Falls Drive.
"He took the gun away from a friend," Hoang Nguyen with the sheriff's office said of the 17-year-old in possession of the gun. "He was afraid the friend had the wrong intention with the gun."
The 17-year-old had taken the gun over to his girlfriend's house and was showing it to his best friend when it went off, Nguyen said.
The 15-year-old was shot in the chest, and the girlfriend remained unharmed.
According to deputies, the 17-year-old said he removed the magazine and triple checked the barrel, so he is unsure why the gun went off.
"He's 17, so he shouldn't be in possession of anything," Nguyen said. "The gun is for safety, not for showing off. When it falls to someone who is not of age, they don't know the safety."
The gun was recovered by authorities and will be tested to determine if it is linked to other crimes.
The girlfriend's father was home at the time of the incident but allegedly didn't know about the gun. Nguyen said he doesn't believe he will be charged.
As for the 17-year-old, no charges have been filed yet but if so, he will be charged as an adult.
The 15-year-old was airlifted to a hospital, where he underwent surgery. Deputies didn't have any updates on the teen's condition.
For more on this story, follow Jeff Ehling on Facebook, Twitter and Instagram.