A Batesville School District student was injured in the parking lot of an elementary school Wednesday morning when a gun accidentally went off, the district superintendent said.

A student was showing off the gun inside a parked car at the Sulphur Rock STEM Magnet elementary school around 7 a.m. when it discharged and hit another student, Superintendent Gary Anderson said.

The injury was not life-threatening, Anderson said, and the student was taken to a hospital.

Anderson said he could not give detailed information about the students' ages or where they went to school but said that they were "older" and did not attend the elementary school.

Anderson said some students wait at the rural elementary school to catch buses to other schools in the district, he said.

"It was early enough that the elementary school students weren't there" at the time the gun went off, Anderson said.

Students are not allowed to have guns on school property, Anderson said. The Independence County sheriff's office is investigating, he said, while district officials will determine any separate school punishment.

"We're extremely lucky it wasn't worse," he said.