CHICAGO — Security video captured the accidental shooting of a 12-year-old boy at a gas station on the city’s South Side.

The shooting happened just after midnight Friday on the 1400 block of East 87th Street.

Police said the boy was accidentally shot after a family member attempted to remove the handgun from their pants pocket.

The boy sustained a graze wound to the left hand and was taken to Comers Children’s Hospital in good condition.

Gas station security video shows the moment the family member dropped the gun, striking the 12-year-old.

A handgun was recovered and Area Two detectives are investigating the circumstances surrounding the incident.