CAMDEN, Ala. (AP) — The parents of an Alabama first-grader were taken into custody after the child accidentally fired a gun at school Friday, officials said.

The incident happened at J.E. Hobbs Elementary School in rural Wilcox County, where District Attorney Michael Jackson said a 6-year-old boy brought a gun to school and the weapon went off.

A bullet hit a wall but no one was hurt, he said. The county school superintendent issued a statement on Facebook saying the gun was in the child’s coat pocket at the time.

The parents were charged with contributing to the delinquency of a minor, Jackson said, but authorities did not immediately release their names.