A handgun stolen from one of two firearm store burglaries last month in Littleton was used in the accidental shooting of a 13-year-old boy in Edgewater, police and federal authorities say.

Edgewater Police Chief John Mackey said investigators used the weapon’s serial number to link it to the July 14 shooting.

“Our officers met the young man and his mother at St. Anthony (Hospital), and the young man reported that he was shot during a street robbery in Edgewater,” Mackey said in an interview Wednesday. “His story unraveled, and it turned out it was an accidental shooting between friends, essentially.”

The handgun was found at an apartment where police think the shooting occurred.

Authorities are working to determine how the handgun wound up in Edgewater, a town on Denver’s western edge, and in the possession of four boys, two of whom are facing charges. The other two remain under investigation. The link to the Littleton burglaries was first reported by KDVR-TV.

“We are still investigating, including how that firearm ended up in Edgewater,” said Lisa Meiman, spokeswoman for the Bureau of Alcohol, Tobacco, Firearms and Explosives.

Mackey said the 13-year-old had a through-and-through gunshot to his lower leg.

“This is real concerning that it ends up here in Edgewater,” he said. “The bottom line is, we’re fortunate it wasn’t worse. The shooting could have resulted in a homicide. The doctor said he was just a very lucky young man.”

The gun shop burglaries happened on consecutive days, June 21 and 22.

In the first, 29 handguns were stolen from Colorado Gun Broker on West Bowles Avenue. The next day, burglars crashed a van into the entrance of Triple J Armory, on East County Line Road, stealing numerous firearms, most of them handguns.

The ATF said both burglaries remain under investigation. Mackey said it wasn’t clear from which store the handgun involved in the teen’s shooting was taken.

Edgewater police, the ATF and Littleton police are investigating the gun thefts.