A man was arrested trying to bring a gun onto a plane at John F. Kennedy international airport through the X-ray machine, officials have announced. 

The suspect, of Wallkill, New York, was caught with the weapon on April 7, the Transportation Security Administration (TSA) announced Monday.

"The TSA officer who was staffing the checkpoint X-ray machine detected the handgun as it passed along the conveyor belt inside the man’s carry-on bag," the TSA said in a press release.

RELATED: $280K stolen in Brooklyn rooftop bank heist

The gun had 10 bullets, including one in the chamber.

No motive was listed.

Guns can be brought on planes inside properly checked bags, but not in carry-on bags.