A woman in Charles County was watching her 4-year-old grandson play one evening last week when he went into a parked car and she heard a gunshot, the county sheriff’s office said.

It happened about 5:50 p.m. Thursday in the 10800 block of Hopewell Place in the La Plata area, the sheriff’s office said.

After the woman heard the sudden shot, the boy ran to her, and she saw that he had a head injury, according to a statement from the county sheriff’s office.

The child was flown to a hospital, where it was determined that he had suffered a graze wound in the accidental shooting, the sheriff’s office said.

The injury was not regarded as life-threatening.

Detectives went to Hopewell Place and found a 9mm semiautomatic handgun in the car, the sheriff’s office said.

The gun was registered to a member of the boy’s family, the sheriff’s office said in its statement.

The sheriff’s office said it was not clear why the gun was in the car, which was in a driveway.

Hopewell Place is in a residential area just south of La Plata Road and about three miles east of downtown of La Plata.

In the statement, which was released Friday, the sheriff’s office said it was investigating.

The boy was not named, and none of his relatives was identified.