A South Carolina technical college student has been arrested after authorities say a gun went off in his pocket during class.

Reports released by Rock Hill police Thursday show 19-year-old Jeremy Moffett originally said the gun fell from his pocket and went off during class at York Technical College on Wednesday.

But reports show Moffett later changed his story to say he was holding the gun and accidentally pulled the trigger. No one was injured.

Police found the .40-caliber Smith & Wesson handgun in the trunk of Moffett's mother's car. Officers say they don't think he wanted to hurt anyone.

Moffett is charged with carrying a weapon on school property, carrying a pistol unlawfully and discharging a firearm within city limits. He's been suspended from school.