The handgun that a 7-year-old shot himself with in his Plymouth home was held "moments before" by an 11-year-old boy, and it may have been left there by a 29-year-old family friend who was arrested four days later, according to a court document filed this week.

These details were among several spelled out in a police search warrant affidavit that reveal more about the time leading up to the shooting at the home on May 16 that killed Keyaris Samuels.

Police said four children ages 7 to 11 were playing without an adult at the home when Keyaris, indoors by himself, found the weapon in a box with a new hoverboard.

The search warrant affidavit, filed in Hennepin County District Court, seeks a judge's permission to collect DNA from the mother's friend in an effort to tie the Minneapolis man to any fingerprints left on the weapon.

Investigators also have collected DNA from Keyaris' mother and the 11-year-old, "who reported handling the gun moments before the incident occurred," the document read.

The court filing also noted that officers found a half-full box of .357-caliber ammunition in a diaper bag. That was the same caliber as the gun Keyaris found in the home at CommonBond Communities' Vicksburg Commons, a townhouse complex on Shenandoah Lane N.

"Evidence found at the scene suggests that the handgun had been negligently stored, causing endangerment to a child," the document read.

Keyaris' mother arrived home shortly after the shooting, according to Plymouth Police Chief Mike Goldstein. She told police she was unaware the gun was in the box and that it was not hers. She said she believed it was brought there by her friend, who had failed to show up for a meeting with his parole officer earlier in the day of the shooting. The meeting related to a 2016 felony drunken driving conviction.

The friend was jailed Sunday at the request of state corrections authorities. The man's parole included provisions against possessing firearms or ammunition.

The Minnesota criminal history of the mother's friend includes six convictions for drunken driving, at least a dozen for driving without a valid license, three for drug possession, and one each for fleeing police and assault.

Goldstein said he and his department are doing "everything in our power to hold the gun owner or owners accountable for their irresponsible and unconscionable actions."

No charges have been filed as of Thursday afternoon in connection with the death of the Wayzata school district first-grader.

There have been at least 70 unintentional shootings by children across the United States so far this year, according to Everytown for Gun Safety, a gun violence prevention group. Among them, 19 were fatal.