American Idol winner Scotty McCreery was cited for carrying a loaded handgun at Raleigh-Durham International Airport, The News & Observer and Associated Press reported Friday.

McCreery had tried to carry the gun through a passenger checkpoint before boarding a flight July 13. While McCreery has a permit to carry, his attempt to bring the 9 mm Smith & Wesson handgun through the checkpoint resulted in a misdemeanor violation.

The singer told police that he'd forgotten to remove the handgun from his bag after visiting a firing range.

“I have been a concealed carry permit holder for awhile now after being robbed at gunpoint in 2014, and I take gun safety very seriously," McCreery, 23, told People. "While in-between tour dates last week, I went to go target shooting with a friend a few days before an early flight out of my hometown Raleigh-Durham airport."

McCreery also said after TSA agents confirmed that he had a permit, they released him to catch the next available flight.

"Great to know our airport security force is on the job. I have learned a lesson that I won't forget," he said.