Dominic Turner, 23, was arrested for child endangerment early Saturday morning at Marin General Hospital, Lt. Barry Heying said.
The boy and his aunt and uncle initially told deputies the shooting happened while they were walking in the 100 block of Drake Avenue in Marin City around 11:30 p.m. Friday, Heying said.
They said they heard a loud noise and the boy felt a pain in his leg, Heying said. They took him to the hospital after the shooting.
Deputies initially believed that someone had fired a gun in a courtyard and that the bullet had struck the teen, Heying said. They searched the area for evidence and witnesses without success.
Investigators then realized that the stories of the aunt, uncle and teen didn't match up.
The uncle eventually admitted he had accidentally shot his nephew while he was handling a .22-caliber pistol to see if it was loaded, Heying said.
The boy also confirmed that's how the shooting happened, Heying said.
The teen had surgery to remove bullet fragments from his lower leg and is expected to make a full recovery, Heying said.
The Marin County District Attorney's Office will decide whether Turner also should be charged with making a false police report, Heying said.