According to People, the Season 13 victor of the former FOX reality TV competition had a permit to carry a concealed handgun.

McCreery told WTVD-TV in a statement that he has learned a lesson he won’t forget, adding, “I take gun safety very seriously”.

The star said he didn’t realize he still had the gun in his backpack until it was found by TSA during the x-ray screening at the security checkpoint before his flight. Investigators found five 9 mm rounds in the magazine of the Smith & Wesson and two boxes of ammo containing 63 bullets in the backpack.

He said that they “rightly confiscated it” and “released” him after to catch a later flight. He was quickly released and is grateful to airport security for being on the job, but says he’s been taught a lesson that he won’t soon forget.

The country singer, who was 2011’s (season 10) American Idol victor, was stopped at 6 p.m. local time when a Transportation Security Administration (TSA) employee saw the weapon in McCreery’s backpack on an X-ray screen. The handgun was inside the middle compartment of McCreery’s backpack, the TSA employee reported.

Almost one year ago, McCreery witnessed the sentencing of Mikkail Jamal Shaw to 17 years in prison for the 2014 home invasion.

Mikkail Jamal Shaw, 21, apologized to McCreery and his friends before Judge Paul Ridgeway handed down the sentence.

Scott McCreery got in some minor trouble at the airport. He said then he was not particularly anxious about security when on the tour bus with his crew.

“My bus would not be the bus to rob”, he said at the time. “And one of the guys is like a black belt in every martial arts you can think of”. A suspect in that home invasion pleaded guilty in 2016.

TSA officials did not provide any official comment on the airport incident.

HuffPost has reached out to McCreery’s representatives and will update this post accordingly.